home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_mtools.idb / usr / freeware / info / mtools.info.z / mtools.info
Encoding:
GNU Info File  |  1998-10-28  |  100.6 KB  |  2,704 lines

  1. This is Info file mtools.info, produced by Makeinfo version 1.67 from
  2. the input file mtools.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Mtools: (mtools).         Mtools: utilities to access DOS disks in Unix.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    Mtools Copyright (C) 1992-1998 Free Software Foundation, Inc.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided that the
  16. entire resulting derived work is distributed under the terms of a
  17. permission notice identical to this one, and provided that the privacy
  18. of any reader of the resulting derived work is respected. In particular
  19. is it strictly forbidden to make this documentation available on a World
  20. Wide Web server which deals cookies. However, keeping access statistics
  21. is allowed.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that this permission notice may be stated in a
  26. translation approved by the Free Software Foundation.
  27.  
  28. 
  29. File: mtools.info,  Node: Top,  Next: Location,  Prev: (dir),  Up: (dir)
  30.  
  31. Introduction
  32. ************
  33.  
  34.    Mtools is a public domain collection of tools to allow Unix systems
  35. to manipulate MS-DOS files: read, write, and move around files on an
  36. MS-DOS filesystem (typically a floppy disk).  Where reasonable, each
  37. program attempts to emulate the MS-DOS equivalent command. However,
  38. unnecessary restrictions and oddities of DOS are not emulated. For
  39. instance, it is possible to move subdirectories from one subdirectory
  40. to another.
  41.  
  42.    Mtools is sufficient to give access to MS-DOS filesystems.  For
  43. instance, commands such as `mdir a:' work on the `a:' floppy without
  44. any preliminary mounting or initialization (assuming the default
  45. `/etc/mtools.conf' works on your machine).  With mtools, one can change
  46. floppies too without unmounting and mounting.
  47.  
  48. * Menu:
  49.  
  50. * Location::          Where to find mtools and early bug fixes
  51. * Common features::   Common features of all mtools commands
  52. * Configuration::     How to configure mtools for your environment
  53. * Commands::          The available mtools commands
  54. * Compiling mtools::  Architecture specific compilation flags
  55. * Porting mtools::    Porting mtools to architectures which are not
  56.                       yet supported
  57.  
  58. * Command Index::     Command Index
  59. * Variable Index::    Variable Index
  60. * Concept Index::     Concept Index
  61.  
  62. Warning, beware of the cookie monster!
  63. **************************************
  64.  
  65.    If you are reading this documentation on the World Wide Web, this
  66. section might interest you.  If you are reading it using info, or as a
  67. printed document, or on one of our own sites
  68. (http://www.tux.org/pub/knaff and http://mtools.linux.lu) you do not
  69. need to worry.
  70.  
  71.    It has come to my attention that some of the Web sites which display
  72. this documentation deal so called "cookies".  These "cookies" are tags
  73. sent from the server to the browser, which enable the server to keep
  74. track of the sites that the user visits, and thus compromise his
  75. privacy.  If you use netscape, you can enable confirmation messages for
  76. any cookies sent to your browser by going into
  77. Options->Network_Preferences->Protocols and checking the box for "Show
  78. an Alert before Accepting a cookie". Then, when the alert box pops up,
  79. click "Cancel" to refuse the cookie and protect your privacy.
  80.  
  81. 
  82. File: mtools.info,  Node: Location,  Next: Common features,  Prev: Top,  Up: Top
  83.  
  84. Where to get mtools
  85. *******************
  86.  
  87.    Mtools can be found at the following places (and their mirrors):
  88.      http://mtools.linux.lu/mtools-3.9.1.tar.gz
  89.      ftp://www.tux.org/pub/knaff/mtools/mtools-3.9.1.tar.gz
  90.      ftp://sunsite.unc.edu/pub/Linux/utils/disk-management/mtools-3.9.1.tar.gz
  91.  
  92.    Before reporting a bug, make sure that it has not yet been fixed in
  93. the Alpha patches which can be found at:
  94.      http://mtools.linux.lu/
  95.      ftp://www.tux.org/pub/knaff/mtools
  96.  
  97.    These patches are named `mtools-'VERSION`-'DDMM`.taz', where version
  98. stands for the base version, DD for the day and MM for the month. Due
  99. to a lack of space, I usually leave only the most recent patch.
  100.  
  101.    There is an mtools mailing list at mtools @ tux.org .  Please send
  102. all bug reports to this list.  You may subscribe to the list by sending
  103. a message with 'subscribe mtools @ tux.org' in its body to majordomo @
  104. tux.org . (N.B. Please remove the spaces around the "@" both times. I
  105. left them there in order to fool spambots.)  Announcements of new
  106. mtools versions will also be sent to the list, in addition to the linux
  107. announce newsgroups.  The mailing list is archived at
  108. http://www.tux.org/hypermail/mtools/latest
  109.  
  110. 
  111. File: mtools.info,  Node: Common features,  Next: Configuration,  Prev: Location,  Up: Top
  112.  
  113. Common features of all mtools commands
  114. **************************************
  115.  
  116. * Menu:
  117.  
  118. * arguments::              What the command line parameters of mtools
  119.                            mean
  120. * drive letters::          Which drives are defined by default
  121. * directory::              Current working directory
  122. * long names::             VFAT-style long filenames
  123. * name clashes::           Name clash handling, and associated command
  124.                            line options
  125. * case sensitivity::       Case sensitivity
  126. * high capacity formats::  How to fit more data on your floppies
  127. * exit codes::             Exit codes
  128. * bugs::                   Happens to everybody
  129.  
  130. 
  131. File: mtools.info,  Node: arguments,  Next: drive letters,  Prev: Common features,  Up: Common features
  132.  
  133. Options and filenames
  134. =====================
  135.  
  136.    MS-DOS filenames are composed of a drive letter followed by a colon,
  137. a subdirectory, and a filename. Only the filename part is mandatory, the
  138. drive letter and the subdirectory are optional. Filenames without a
  139. drive letter refer to Unix files. Subdirectory names can use either the
  140. '`/'' or '`\'' separator.  The use of the '`\'' separator or wildcards
  141. requires the names to be enclosed in quotes to protect them from the
  142. shell. However, wildcards in Unix filenames should not be enclosed in
  143. quotes, because here we *want* the shell to expand them.
  144.  
  145.    The regular expression "pattern matching" routines follow the
  146. Unix-style rules.  For example, ``*'' matches all MS-DOS files in lieu
  147. of ``*.*''.  The archive, hidden, read-only and system attribute bits
  148. are ignored during pattern matching.
  149.  
  150.    All options use the `-' (minus) as their first character, not `/' as
  151. you'd expect in MS-DOS.
  152.  
  153.    Most mtools commands allow multiple filename parameters, which
  154. doesn't follow MS-DOS conventions, but which is more user-friendly.
  155.  
  156.    Most mtools commands allow options that instruct them how to handle
  157. file name clashes. *Note name clashes::, for more details on these. All
  158. commands accept the `-V' flags which prints the version, and most
  159. accept the `-v' flag, which switches on verbose mode. In verbose mode,
  160. these commands print out the name of the MS-DOS files upon which they
  161. act, unless stated otherwise. *Note Commands::, for a description of
  162. the options which are specific to each command.
  163.  
  164. 
  165. File: mtools.info,  Node: drive letters,  Next: directory,  Prev: arguments,  Up: Common features
  166.  
  167. Drive letters
  168. =============
  169.  
  170.    The meaning of the drive letters depends on the target architectures.
  171. However, on most target architectures, drive A is the first floppy
  172. drive, drive B is the second floppy drive (if available), drive J is a
  173. Jaz drive (if available), and drive Z is a Zip drive (if available).  On
  174. those systems where the device name is derived from the SCSI id, the Jaz
  175. drive is assumed to be at Scsi target 4, and the Zip at Scsi target 5
  176. (factory default settings).  On Linux, both drives are assumed to be the
  177. second drive on the Scsi bus (/dev/sdb). The default settings can be
  178. changes using a configuration file (*Note Configuration::).
  179.  
  180. 
  181. File: mtools.info,  Node: directory,  Next: long names,  Prev: drive letters,  Up: Common features
  182.  
  183. Current working directory
  184. =========================
  185.  
  186.    The `mcd' command (*Note mcd::) is used to establish the device and
  187. the current working directory (relative to the MS-DOS filesystem),
  188. otherwise the default is assumed to be `A:/'. However, unlike MS-DOS,
  189. there is only one working directory for all drives, and not one per
  190. drive.
  191.  
  192. 
  193. File: mtools.info,  Node: long names,  Next: name clashes,  Prev: directory,  Up: Common features
  194.  
  195. VFAT-style long file names
  196. ==========================
  197.  
  198.    This version of mtools supports VFAT style long filenames. If a Unix
  199. filename is too long to fit in a short DOS name, it is stored as a VFAT
  200. long name, and a companion short name is generated. This short name is
  201. what you see when you examine the disk with a pre-7.0 version of DOS.
  202. The following table shows some examples of short names:
  203.  
  204.      Long name       MS-DOS name      Reason for the change
  205.      ---------       ----------      ---------------------
  206.      thisisatest     THISIS~1        filename too long
  207.      alain.knaff     ALAIN~1.KNA     extension too long
  208.      prn.txt         PRN~1.TXT       PRN is a device name
  209.      .abc            ABC~1           null filename
  210.      hot+cold        HOT_CO~1        illegal character
  211.  
  212.    As you see, the following transformations happen to derive a short
  213. name:
  214.    * Illegal characters are replaced by underscores. The illegal
  215.      characters are `;+=[]',\"*\\<>/?:|'.
  216.  
  217.    * Extra dots, which cannot be interpreted as a main name/extension
  218.      separator are removed
  219.  
  220.    * A `~'N number is generated,
  221.  
  222.    * The name is shortened so as to fit in the 8+3 limitation
  223.  
  224.    The initial Unix-style file name (whether long or short) is also
  225. called the "primary" name, and the derived short name is also called the
  226. "secondary" name.
  227.  
  228.    Example:
  229.       mcopy /etc/motd a:Reallylongname
  230.     Mtools creates a VFAT entry for Reallylongname, and uses REALLYLO as
  231. a short name. Reallylongname is the primary name, and REALLYLO is the
  232. secondary name.
  233.       mcopy /etc/motd a:motd
  234.     Motd fits into the DOS filename limits. Mtools doesn't need to
  235. derivate another name. Motd is the primary name, and there is no
  236. secondary name.
  237.  
  238.    In a nutshell: The primary name is the long name, if one exists, or
  239. the short name if there is no long name.
  240.  
  241.    Although VFAT is much more flexible than FAT, there are still names
  242. that are not acceptable, even in VFAT. There are still some illegal
  243. characters left (`\"*\\<>/?:|'), and device names are still reserved.
  244.  
  245.      Unix name       Long name      Reason for the change
  246.      ---------       ----------      ---------------------
  247.      prn             prn-1           PRN is a device name
  248.      ab:c            ab_c-1          illegal character
  249.  
  250.    As you see, the following transformations happen if a long name is
  251. illegal:
  252.    * Illegal characters are replaces by underscores,
  253.  
  254.    * A `-'N number is generated,
  255.  
  256. 
  257. File: mtools.info,  Node: name clashes,  Next: case sensitivity,  Prev: long names,  Up: Common features
  258.  
  259. Name clashes
  260. ============
  261.  
  262.    When writing a file to disk, its long name or short name may collide
  263. with an already existing file or directory. This may happen for all
  264. commands which create new directory entries, such as `mcopy', `mmd',
  265. `mren', `mmove', `mwrite' and `mread'. When a name clash happens,
  266. mtools asks you what it should do. It offers several choices:
  267.  
  268. `overwrite'
  269.      Overwrites the existing file. It is not possible to overwrite a
  270.      directory with a file.
  271.  
  272. `rename'
  273.      Renames the newly created file. Mtools prompts for the new filename
  274.  
  275. `autorename'
  276.      Renames the newly created file. Mtools chooses a name by itself,
  277.      without prompting
  278.  
  279. `skip'
  280.      Gives up on this file, and moves on to the next (if any)
  281.  
  282.    To chose one of these actions, type its first letter at the prompt.
  283. If you use a lower case letter, the action only applies for this file
  284. only, if you use an upper case letter, the action applies to all files,
  285. and you won't be prompted again.
  286.  
  287.    You may also chose actions (for all files) on the command line, when
  288. invoking mtools:
  289.  
  290. `-o'
  291.      Overwrites primary names by default.
  292.  
  293. `-O'
  294.      Overwrites secondary names by default.
  295.  
  296. `-r'
  297.      Renames primary name by default.
  298.  
  299. `-R'
  300.      Renames secondary name by default.
  301.  
  302. `-a'
  303.      Autorenames primary name by default.
  304.  
  305. `-A'
  306.      Autorenames secondary name by default.
  307.  
  308. `-s'
  309.      Skip primary name by default.
  310.  
  311. `-S'
  312.      Skip secondary name by default.
  313.  
  314. `-m'
  315.      Ask user what to do with primary name.
  316.  
  317. `-M'
  318.      Ask user what to do with secondary name.
  319.  
  320.    Note that for command line switches lower/upper differentiates
  321. between primary/secondary name whereas for interactive choices,
  322. lower/upper differentiates between just-this-time/always.
  323.  
  324.    The primary name is the name as displayed in Windows 95 or Windows
  325. NT: i.e. the long name if it exists, and the short name otherwise.  The
  326. secondary name is the "hidden" name, i.e. the short name if a long name
  327. exists.
  328.  
  329.    By default, the user is prompted if the primary name clashes, and the
  330. secondary name is autorenamed.
  331.  
  332.    If a name clash occurs in a Unix directory, mtools only asks whether
  333. to overwrite the file, or to skip it.
  334.  
  335. 
  336. File: mtools.info,  Node: case sensitivity,  Next: high capacity formats,  Prev: name clashes,  Up: Common features
  337.  
  338. Case sensitivity of the VFAT filesystem
  339. =======================================
  340.  
  341.    The VFAT filesystem is able to remember the case of the filenames.
  342. However, filenames which differ only in case are not allowed to coexist
  343. in the same directory. For example if you store a file called
  344. LongFileName on a VFAT filesystem, mdir shows this file as LongFileName,
  345. and not as Longfilename. However, if you then try to add LongFilename to
  346. the same directory, it is refused, because case is ignored for clash
  347. checks.
  348.  
  349.    The VFAT filesystem allows to store the case of a filename in the
  350. attribute byte, if all letters of the filename are the same case, and if
  351. all letters of the extension are the same case too. Mtools uses this
  352. information when displaying the files, and also to generate the Unix
  353. filename when mcopying to a Unix directory. This may have unexpected
  354. results when applied to files written using an pre-7.0 version of DOS:
  355. Indeed, the old style filenames map to all upper case. This is different
  356. from the behavior of the old version of mtools which used to generate
  357. lower case Unix filenames.
  358.  
  359. 
  360. File: mtools.info,  Node: high capacity formats,  Next: exit codes,  Prev: case sensitivity,  Up: Common features
  361.  
  362. high capacity formats
  363. =====================
  364.  
  365.    Mtools supports a number of formats which allow to store more data on
  366. disk as usual. Due to different operating system abilities, these
  367. formats are not supported on all OS'es. Mtools recognizes these formats
  368. transparently where supported.
  369.  
  370.    In order to format these disks, you need to use an operating system
  371. specific tool. For Linux, suitable floppy tools can be found in the
  372. `fdutils' package at the following locations~:
  373.      `ftp://www.tux.org/pub/knaff/fdutils/'.
  374.      `ftp://sunsite.unc.edu/pub/Linux/utils/disk-management/fdutils-*'
  375.  
  376.    See the manpages included in that package for further detail: Use
  377. `superformat' to format all formats except XDF, and use `xdfcopy' to
  378. format XDF.
  379.  
  380. * Menu:
  381.  
  382. * more sectors::      Putting more sectors per track on the disk
  383. * bigger sectors::    Use bigger sectors to save header space
  384. * 2m::                Use a standard first track
  385. * XDF::               OS/2's eXtended density format
  386.  
  387. 
  388. File: mtools.info,  Node: more sectors,  Next: bigger sectors,  Prev: high capacity formats,  Up: high capacity formats
  389.  
  390. More sectors
  391. ------------
  392.  
  393.    The oldest method of fitting more data on a disk is to use more
  394. sectors and more cylinders. Although the standard format uses 80
  395. cylinders and 18 sectors (on a 3 1/2 high density disk), it is possible
  396. to use up to 83 cylinders (on most drives) and up to 21 sectors. This
  397. method allows to store up to 1743K on a 3 1/2 HD disk. However, 21
  398. sector disks are twice as slow as the standard 18 sector disks because
  399. the sectors are packed so close together that we need to interleave
  400. them. This problem doesn't exist for 20 sector formats.
  401.  
  402.    These formats are supported by numerous DOS shareware utilities such
  403. as `fdformat' and `vgacopy'. In his infinite hybris, Bill Gate$
  404. believed that he invented this, and called it `DMF disks', or `Windows
  405. formatted disks'. But in reality, it has already existed years before!
  406. Mtools supports these formats on Linux, on SunOs and on the DELL Unix
  407. PC.
  408.  
  409. 
  410. File: mtools.info,  Node: bigger sectors,  Next: 2m,  Prev: more sectors,  Up: high capacity formats
  411.  
  412. Bigger sectors
  413. --------------
  414.  
  415.    By using bigger sectors it is possible to go beyond the capacity
  416. which can be obtained by the standard 512-byte sectors. This is because
  417. of the sector header. The sector header has the same size, regardless
  418. of how many data bytes are in the sector. Thus, we save some space by
  419. using *fewer*, but bigger sectors. For example, 1 sector of 4K only
  420. takes up header space once, whereas 8 sectors of 512 bytes have also 8
  421. headers, for the same amount of useful data.
  422.  
  423.    This method allows to store up to 1992K on a 3 1/2 HD disk.
  424.  
  425.    Mtools supports these formats only on Linux.
  426.  
  427. 
  428. File: mtools.info,  Node: 2m,  Next: XDF,  Prev: bigger sectors,  Up: high capacity formats
  429.  
  430. 2m
  431. --
  432.  
  433.    The 2m format was originally invented by Ciriaco Garcia de Celis. It
  434. also uses bigger sectors than usual in order to fit more data on the
  435. disk.  However, it uses the standard format (18 sectors of 512 bytes
  436. each) on the first cylinder, in order to make these disks easyer to
  437. handle by DOS. Indeed this method allows to have a standard sized
  438. bootsector, which contains a description of how the rest of the disk
  439. should be read.
  440.  
  441.    However, the drawback of this is that the first cylinder can hold
  442. less data than the others. Unfortunately, DOS can only handle disks
  443. where each track contains the same amount of data. Thus 2m hides the
  444. fact that the first track contains less data by using a "shadow FAT".
  445. (Usually, DOS stores the FAT in two identical copies, for additional
  446. safety.  XDF stores only one copy, and it tells DOS that it stores two.
  447. Thus the same that would be taken up by the second FAT copy is saved.)
  448. This also means that your should *never use a 2m disk to store anything
  449. else than a DOS fs*.
  450.  
  451.    Mtools supports these format only on Linux.
  452.  
  453. 
  454. File: mtools.info,  Node: XDF,  Prev: 2m,  Up: high capacity formats
  455.  
  456. XDF
  457. ---
  458.  
  459.    XDF is a high capacity format used by OS/2. It can hold 1840 K per
  460. disk. That's lower than the best 2m formats, but its main advantage is
  461. that it is fast: 600 milliseconds per track. That's faster than the 21
  462. sector format, and almost as fast as the standard 18 sector format. In
  463. order to access these disks, make sure mtools has been compiled with XDF
  464. support, and set the `use_xdf' variable for the drive in the
  465. configuration file. *Note Compiling mtools:: and *Note misc variables::,
  466. for details on how to do this. Fast XDF access is only available for
  467. Linux kernels which are more recent than 1.1.34.
  468.  
  469.    Mtools supports this format only on Linux.
  470.  
  471.    *Caution / Attention distributors*: If mtools is compiled on a Linux
  472. kernel more recent than 1.3.34, it won't run on an older kernel.
  473. However, if it has been compiled on an older kernel, it still runs on a
  474. newer kernel, except that XDF access is slower. It is recommended that
  475. distribution authors only include mtools binaries compiled on kernels
  476. older than 1.3.34 until 2.0 comes out. When 2.0 will be out, mtools
  477. binaries compiled on newer kernels may (and should) be distributed.
  478. Mtools binaries compiled on kernels older than 1.3.34 won't run on any
  479. 2.1 kernel or later.
  480.  
  481. 
  482. File: mtools.info,  Node: exit codes,  Next: bugs,  Prev: high capacity formats,  Up: Common features
  483.  
  484. Exit codes
  485. ==========
  486.  
  487.    All the Mtools commands return 0 on success, 1 on utter failure, or 2
  488. on partial failure.  All the Mtools commands perform a few sanity
  489. checks before going ahead, to make sure that the disk is indeed an
  490. MS-DOS disk (as opposed to, say an ext2 or minix disk). These checks
  491. may reject partially corrupted disks, which might otherwise still be
  492. readable. To avoid these checks, set the MTOOLS_SKIP_CHECK
  493. environmental variable or the corresponding configuration file variable
  494. (*note global variables::.)
  495.  
  496. 
  497. File: mtools.info,  Node: bugs,  Prev: exit codes,  Up: Common features
  498.  
  499. Bugs
  500. ====
  501.  
  502.    An unfortunate side effect of not guessing the proper device (when
  503. multiple disk capacities are supported) is an occasional error message
  504. from the device driver.  These can be safely ignored.
  505.  
  506.    The fat checking code chokes on 1.72 Mb disks mformatted with
  507. pre-2.0.7 mtools. Set the environmental variable
  508. MTOOLS_FAT_COMPATIBILITY (or the corresponding configuration file
  509. variable, *Note global variables::) to bypass the fat checking.
  510.  
  511. 
  512. File: mtools.info,  Node: Configuration,  Next: Commands,  Prev: Common features,  Up: Top
  513.  
  514. How to configure mtools for your environment
  515. ********************************************
  516.  
  517. Description
  518. ===========
  519.  
  520.    This sections explains the syntax of the configurations files for
  521. mtools. The configuration files are called
  522. `/usr/freeware/etc/mtools.conf' and `~/.mtoolsrc'. If the environmental
  523. variable `MTOOLSRC' is set, its contents is used as the filename for a
  524. third configuration file. These configuration files describe the
  525. following items:
  526.  
  527.    * Global configuration flags and variables
  528.  
  529.    * Per drive flags and variables
  530.  
  531.    * Character translation tables
  532.  
  533. * Menu:
  534.  
  535. * config file location::  Where mtools looks for its configuration files
  536. * general syntax::        The layout of the configuration files
  537. * default values::        Why you don't need a config file in most cases
  538. * global variables::      Variables that are independent of the drive
  539. * per drive variables::   Variables that are specific to a given drive
  540. * character sets::        Character set translation tables
  541. * parsing order::         Location of configuration files and parsing order
  542. * old style config::      Backwards compatibility
  543.  
  544. 
  545. File: mtools.info,  Node: config file location,  Next: general syntax,  Prev: Configuration,  Up: Configuration
  546.  
  547. Location of the configuration files
  548. ===================================
  549.  
  550.    `/usr/freeware/etc/mtools.conf' is the system-wide configuration
  551. file, and `~/.mtoolsrc' is the user's private configuration file.
  552.  
  553.    On some systems, the system-wide configuration file is called
  554. `/etc/defaults/mtools.conf' instead.
  555.  
  556. 
  557. File: mtools.info,  Node: general syntax,  Next: default values,  Prev: config file location,  Up: Configuration
  558.  
  559. General configuration file syntax
  560. ---------------------------------
  561.  
  562.    The configuration files is made up of sections. Each section starts
  563. with a keyword identifying the section followed by a colon.  Then
  564. follow variable assignments and flags. Variable assignments take the
  565. following form:
  566.      name=value
  567.    Flags are lone keywords without an equal sign and value following
  568. them.  A section either ends at the end of the file or where the next
  569. section begins.
  570.  
  571.    Lines starting with a hash (`#') are comments. Newline characters
  572. are equivalent to whitespace (except where ending a comment). The
  573. configuration file is case insensitive, except for item enclosed in
  574. quotes (such as filenames).
  575.  
  576. 
  577. File: mtools.info,  Node: default values,  Next: global variables,  Prev: general syntax,  Up: Configuration
  578.  
  579. Default values
  580. ==============
  581.  
  582.    For most platforms, mtools contains reasonable compiled-in defaults
  583. for physical floppy drives.  Thus, you usually don't need to bother
  584. with the configuration file, if all you want to do with mtools is to
  585. access your floppy drives. On the other hand, the configuration file is
  586. needed if you also want to use mtools to access your hard disk
  587. partitions and dosemu image files.
  588.  
  589. 
  590. File: mtools.info,  Node: global variables,  Next: per drive variables,  Prev: default values,  Up: Configuration
  591.  
  592. Global variables
  593. ================
  594.  
  595.    Global flags may be set to 1 or to 0.
  596.  
  597.    The following global flags are recognized:
  598.  
  599. `MTOOLS_SKIP_CHECK'
  600.      If this is set to 1, mtools skips most of its sanity checks. This
  601.      is needed to read some Atari disks which have been made with the
  602.      earlier ROMs, and which would not be recognized otherwise.
  603.  
  604. `MTOOLS_FAT_COMPATIBILITY'
  605.      If this is set to 1, mtools skips the fat size checks. Some disks
  606.      have a bigger FAT than they really need to. These are rejected if
  607.      this option is not set.
  608.  
  609. `MTOOLS_LOWER_CASE'
  610.      If this is set to 1, mtools displays all-upper-case short
  611.      filenames as lowercase. This has been done to allow a behavior
  612.      which is consistent with older versions of mtools which didn't
  613.      know about the case bits.
  614.  
  615. `MTOOLS_NO_VFAT'
  616.      If this is set to 1, mtools won't generate VFAT entries for
  617.      filenames which are mixed-case, but otherwise legal dos filenames.
  618.      This is useful when working with DOS versions which can't grok
  619.      VFAT longnames, such as FreeDos.
  620.  
  621. `MTOOLS_DOTTED_DIR'
  622.      In a wide directory, prints the short name with a dot instead of
  623.      spaces separating the basename and the extension.
  624.  
  625. `MTOOLS_NAME_NUMERIC_TAIL'
  626.      If this is set to one (default), generate numeric tails for all
  627.      long names (~1).  If set to zero, only generate numeric tails if
  628.      otherwise a clash would have happened.
  629.  
  630. `MTOOLS_TWENTY_FOUR_HOUR_CLOCK'
  631.      If 1, uses the European notation for times (twenty four hour
  632.      clock), else uses the UK/US notation (am/pm)
  633.  
  634.    Example: Inserting the following line into your configuration file
  635. instructs mtools to skip the sanity checks:
  636.        MTOOLS_SKIP_CHECK=1
  637.  
  638.    Global variables may also be set via the environment:
  639.        export MTOOLS_SKIP_CHECK=1
  640.  
  641.    Global string variables may be set to any value:
  642. `MTOOLS_DATE_STRING'
  643.      The format used for printing dates of files.  By default, is
  644.      dd-mm-yyyy.
  645.  
  646. 
  647. File: mtools.info,  Node: per drive variables,  Next: character sets,  Prev: global variables,  Up: Configuration
  648.  
  649. Per drive flags and variables
  650. =============================
  651.  
  652. * Menu:
  653.  
  654. * general information::   What a drive description looks like
  655. * geometry description::  Describes the physical characteristics of
  656.                           the media
  657. * open flags::            Flags passed to the open system call when the
  658.                           device is opened
  659. * misc variables::        Variables which don't fit in either category
  660. * misc flags::          Switch variables, which can be enabled or disabled
  661. * multiple descriptions:: How to supply several descriptions for a
  662.                           drive, to be tried one after the other.
  663.  
  664. 
  665. File: mtools.info,  Node: general information,  Next: geometry description,  Prev: per drive variables,  Up: per drive variables
  666.  
  667. General information
  668. -------------------
  669.  
  670.    Per drive flags and values may be described in a drive section. A
  671. drive section starts with `drive' "DRIVELETTER" :
  672.  
  673.    Then follow variable-value pairs and flags.
  674.  
  675.    This is a sample drive description:
  676.        drive a:
  677.          file="/dev/fd0" use_xdf=1
  678.  
  679. 
  680. File: mtools.info,  Node: geometry description,  Next: open flags,  Prev: general information,  Up: per drive variables
  681.  
  682. Disk Geometry Configuration
  683. ---------------------------
  684.  
  685.    Geometry information describes the physical characteristics about the
  686. disk. Its has three purposes:
  687.  
  688. formatting
  689.      The geometry information is written into the boot sector of the
  690.      newly made disk. However, you may also describe the geometry
  691.      information on the command line. *Note mformat:: for details.
  692.  
  693. filtering
  694.      On some Unices there are device nodes which only support one
  695.      physical geometry. For instance, you might need a different node
  696.      to access a disk as high density or as low density. The geometry
  697.      is compared to the actual geometry stored on the boot sector to
  698.      make sure that this device node is able to correctly read the
  699.      disk. If the geometry doesn't match, this drive entry fails, and
  700.      the next drive entry bearing the same drive letter is tried. *Note
  701.      multiple descriptions:: for more details on supplying several
  702.      descriptions for one drive letter.
  703.  
  704.      If no geometry information is supplied in the configuration file,
  705.      all disks are accepted. On Linux (and on Sparc) there exist device
  706.      nodes with configurable geometry (`/dev/fd0', `/dev/fd1' etc), and
  707.      thus filtering is not needed (and ignored) for disk drives.
  708.      (Mtools still does do filtering on plain files (disk images) in
  709.      Linux: this is mainly intended for test purposes, as I don't have
  710.      access to a Unix which would actually need filtering).
  711.  
  712.      If you do not need filtering, but want still a default geometry for
  713.      mformatting, you may switch off filtering using the `mformat_only'
  714.      flag.
  715.  
  716. initial geometry
  717.      On devices that support it (usually floppy devices), the geometry
  718.      information is also used to set the initial geometry. This initial
  719.      geometry is applied while reading the boot sector, which contains
  720.      the real geometry.  If no geometry information is supplied in the
  721.      configuration file, or if the `mformat_only' flag is supplied, no
  722.      initial configuration is done.
  723.  
  724.      On Linux, initial geometry is not really needed, as the
  725.      configurable devices are able to auto-detect the disk type
  726.      accurately enough (for most common formats) to read the boot
  727.      sector.
  728.  
  729.    Wrong geometry information may lead to very bizarre errors. That's
  730. why I strongly recommend that you add the `mformat_only' flag to your
  731. drive description, unless you really need filtering or initial geometry.
  732.  
  733.    The following geometry related variables are available:
  734.  
  735. `cylinders'
  736. `tracks'
  737.      The number of cylinders. (`cylinders' is the preferred form,
  738.      `tracks' is considered obsolete)
  739.  
  740. `heads'
  741.      The number of heads (sides).
  742.  
  743. `sectors'
  744.      The number of sectors per track.
  745.  
  746.    Example: the following drive section describes a 1.44M drive:
  747.  
  748.        drive a:
  749.            file="/dev/fd0H1440"
  750.            fat_bits=12
  751.            cylinders=80 heads=2 sectors=18
  752.  
  753.    The following shorthand geometry descriptions are available:
  754.  
  755. `1.44m'
  756.      high density 3 1/2 disk. Equivalent to: `fat_bits=12 cylinders=80
  757.      heads=2 sectors=18'
  758.  
  759. `1.2m'
  760.      high density 5 1/4 disk. Equivalent to: `fat_bits=12 cylinders=80
  761.      heads=2 sectors=15'
  762.  
  763. `720k'
  764.      double density 3 1/2 disk. Equivalent to: `fat_bits=12
  765.      cylinders=80 heads=2 sectors=9'
  766.  
  767. `360k'
  768.      double density 5 1/4 disk. Equivalent to: `fat_bits=12
  769.      cylinders=40 heads=2 sectors=9'
  770.  
  771.    The shorthand format descriptions may be amended. For example, `360k
  772. sectors=8' describes a 320k disk and is equivalent to: `fat_bits=12
  773. cylinders=40 heads=2 sectors=8'
  774.  
  775. 
  776. File: mtools.info,  Node: open flags,  Next: misc variables,  Prev: geometry description,  Up: per drive variables
  777.  
  778. Open Flags
  779. ----------
  780.  
  781.    Moreover, the following flags are available:
  782.  
  783. `sync'
  784.      All i/o operations are done synchronously
  785.  
  786. `nodelay'
  787.      The device or file is opened with the O_NDELAY flag. This is
  788.      needed on some non-Linux architectures.
  789.  
  790. `exclusive'
  791.      The device or file is opened with the O_EXCL flag. On Linux, this
  792.      ensures exclusive access to the floppy drive. On most other
  793.      architectures, and for plain files it has no effect at all.
  794.  
  795. 
  796. File: mtools.info,  Node: misc variables,  Next: misc flags,  Prev: open flags,  Up: per drive variables
  797.  
  798. General Purpose Drive Variables
  799. ===============================
  800.  
  801.    The following general purpose drive variables are available.
  802. Depending to their type, these variables can be set to a string (file,
  803. precmd) or an integer (all others)
  804.  
  805. `file'
  806.      The name of the file or device holding the disk image. This is
  807.      mandatory. The file name should be enclosed in quotes.
  808.  
  809. `partition'
  810.      Tells mtools to treat the drive as a partitioned device, and to
  811.      use the given partition. Only primary partitions are accessible
  812.      using this method, and they are numbered from 1 to 4. For logical
  813.      partitions, use the more general `offset' variable. The
  814.      `partition' variable is intended for removable media such as
  815.      Syquests, ZIP drives, and magneto-optical disks. Although
  816.      traditional DOS sees Syquests and magneto-optical disks as `giant
  817.      floppy disks' which are unpartitioned, OS/2 and Windows NT treat
  818.      them like hard disks, i.e. partioned devices. The `partition' flag
  819.      is also useful DOSEMU hdimages. It is not recommended for hard
  820.      disks for which direct access to partitions is available through
  821.      mounting.
  822.  
  823. `offset'
  824.      Describes where in the file the MS-DOS filesystem starts. This is
  825.      useful for logical partitions in DOSEMU hdimages, and for ATARI
  826.      ram disks. By default, this is zero, meaning that the filesystem
  827.      starts right at the beginning of the device or file.
  828.  
  829. `fat_bits'
  830.      The number of FAT bits. This may be 12 or 16. This is very rarely
  831.      needed, as it can almost always be deduced from information in the
  832.      boot sector. On the contrary, describing the number of fat bits may
  833.      actually be harmful if you get it wrong. You should only use it if
  834.      mtools gets the autodetected number of fat bits wrong, or if you
  835.      want to mformat a disk with a weird number of fat bits.
  836.  
  837. `precmd'
  838.      On some variants of Solaris, it is necessary to call 'volcheck -v'
  839.      before opening a floppy device, in order for the system to notice
  840.      that there is indeed a disk in the drive. `precmd="volcheck -v"'
  841.      in the drive clause establishes the desired behavior.
  842.  
  843. `blocksize'
  844.      This parameter represents a default block size to be always used
  845.      on this device.  All I/O is done with multiples of this block size,
  846.      independantly of the sector size registered in the filesystem's
  847.      boot sector.  This is useful for character devices whose sector
  848.      size is not 512, such as for example CD Rom drives on Solaris.
  849.  
  850.    Only the `file' variable is mandatory. The other parameters may be
  851. left out. In that case a default value or an autodetected value is used.
  852.  
  853. 
  854. File: mtools.info,  Node: misc flags,  Next: multiple descriptions,  Prev: misc variables,  Up: per drive variables
  855.  
  856. General Purpose Drive Flags
  857. ===========================
  858.  
  859.    A flag can either be set to 1 (enabled) or 0 (disabled). If the
  860. value is ommitted, it is enabled.  For example, `scsi' is equivalent to
  861. `scsi=1'
  862.  
  863. `nolock'
  864.      Instruct mtools to not use locking on this drive.  This is needed
  865.      on systems with buggy locking semantics.  However, enabling this
  866.      makes operation less safe in cases where several users may access
  867.      the same drive at the same time.
  868.  
  869. `scsi'
  870.      When set to 1, this option tells mtools to use raw SCSI I/O
  871.      instead of the standard read/write calls to access the device.
  872.      Currently, this is supported on HP/UX, Solaris and SunOs.  This is
  873.      needed because on some architectures, such as SunOs or Solaris, PC
  874.      media can't be accessed using the `read' and `write' syscalls,
  875.      because the OS expects them to contain a Sun specific "disk label".
  876.  
  877.      As raw Scsi access always uses the whole device, you need to
  878.      specify the "partition" flag in addition
  879.  
  880.      On some architectures, such as Solaris, mtools needs root
  881.      privileges to be able to use the `scsi' option.  Thus mtools
  882.      should be installed set uid root on Solaris if you want to access
  883.      Zip/Jaz drives.  Thus, if the `scsi' flag is given, `privileged'
  884.      is automatically implied, unless explicitly disabled by
  885.      `privileged=0'
  886.  
  887.      Mtools uses its root privileges to open the device, and to issue
  888.      the actual SCSI I/O calls.  Moreover, root privileges are only
  889.      used for drives described in a system-wide configuration file such
  890.      as `/usr/freeware/etc/mtools.conf', and not for those described in
  891.      `~/.mtoolsrc' or `$MTOOLSRC'.
  892.  
  893. `privileged'
  894.      When set to 1, this instructs mtools to use its set-uid and set-gid
  895.      privileges for opening the given drive.  This option is only valid
  896.      for drives described in the system-wide configuration files (such
  897.      as `/usr/freeware/etc/mtools.conf', not `~/.mtoolsrc' or
  898.      `$MTOOLSRC').  Obviously, this option is also a no op if mtools is
  899.      not installed setuid or setgid.  This option is implied by
  900.      'scsi=1', but again only for drives defined in system-wide
  901.      configuration files.  Privileged may also be set explicitely to 0,
  902.      in order to tell mtools not to use its privileges for a given
  903.      drive even if `scsi=1' is set.
  904.  
  905.      Mtools only needs to be installed setuid if you use the
  906.      `privileged' or `scsi' drive variables.  If you do not use these
  907.      options, mtools works perfectly well even when not installed
  908.      setuid root.
  909.  
  910. `vold'
  911.      Instructs mtools to interpret the device name as a vold identifier
  912.      rather than as a filename.  The vold identifier is translated into
  913.      a real filename using the `media_findname()' and
  914.      `media_oldaliases()' functions of the `volmgt' library.  This flag
  915.      is only available if you configured mtools with the
  916.      `--enable-new-vold' option before compilation.
  917.  
  918. `use_xdf'
  919.      If this is set to a non-zero value, mtools also tries to access
  920.      this disk as an XDF disk. XDF is a high capacity format used by
  921.      OS/2. This is off by default. *Note XDF:: for more details.
  922.  
  923. `mformat_only'
  924.      Tells mtools to use the geometry for this drive only for
  925.      mformatting and not for filtering.
  926.  
  927. `remote'
  928.      Tells mtools to connect to floppyd (*Note floppyd::).
  929.  
  930. 
  931. File: mtools.info,  Node: multiple descriptions,  Prev: misc flags,  Up: per drive variables
  932.  
  933. Supplying multiple descriptions for a drive
  934. -------------------------------------------
  935.  
  936.    It is possible to supply multiple descriptions for a drive. In that
  937. case, the descriptions are tried in order until one is found that fits.
  938. Descriptions may fail for several reasons:
  939.  
  940.   1. because the geometry is not appropriate,
  941.  
  942.   2. because there is no disk in the drive,
  943.  
  944.   3. or because of other problems.
  945.  
  946.    Multiple definitions are useful when using physical devices which are
  947. only able to support one single disk geometry.  Example:
  948.        drive a: file="/dev/fd0H1440" 1.44m
  949.        drive a: file="/dev/fd0H720" 720k
  950.  
  951.    This instructs mtools to use /dev/fd0H1440 for 1.44m (high density)
  952. disks and /dev/fd0H720 for 720k (double density) disks. On Linux, this
  953. feature is not really needed, as the /dev/fd0 device is able to handle
  954. any geometry.
  955.  
  956.    You may also use multiple drive descriptions to access both of your
  957. physical drives through one drive letter:
  958.  
  959.        drive z: file="/dev/fd0"
  960.        drive z: file="/dev/fd1"
  961.  
  962.    With this description, `mdir z:' accesses your first physical drive
  963. if it contains a disk. If the first drive doesn't contain a disk,
  964. mtools checks the second drive.
  965.  
  966.    When using multiple configuration files, drive descriptions in the
  967. files parsed last override descriptions for the same drive in earlier
  968. files. In order to avoid this, use the `drive+' or `+drive' keywords
  969. instead of `drive'. The first adds a description to the end of the list
  970. (i.e. it will be tried last), and the first adds it to the start of the
  971. list.
  972.  
  973. 
  974. File: mtools.info,  Node: character sets,  Next: parsing order,  Prev: per drive variables,  Up: Configuration
  975.  
  976. Character set translation tables
  977. ================================
  978.  
  979.    If you live in the USA, in Western Europe or in Australia, you may
  980. skip this section.
  981.  
  982. * Menu:
  983.  
  984. * why::              Why character set tables are needed
  985. * country::          Using the COUNTRY variable to select tables
  986. * explicit tables::  Supplying a new table for an unknown country
  987.  
  988. 
  989. File: mtools.info,  Node: why,  Next: country,  Prev: character sets,  Up: character sets
  990.  
  991. Why character set translation tables are needed
  992. -----------------------------------------------
  993.  
  994.    DOS uses a different character code mapping than Unix. 7-bit
  995. characters still have the same meaning, only characters with the eight
  996. bit set are affected. To make matters worse, there are several
  997. translation tables available depending on the country where you are.
  998. The appearance of the characters is defined using code pages. These
  999. code pages aren't the same for all countries. For instance, some code
  1000. pages don't contain upper case accented characters. On the other hand,
  1001. some code pages contain characters which don't exist in Unix, such as
  1002. certain line-drawing characters or accented consonants used by some
  1003. Eastern European countries. This affects two things, relating to
  1004. filenames:
  1005.  
  1006. upper case characters
  1007.      In short names, only upper case characters are allowed. This also
  1008.      holds for accented characters. For instance, in a code page which
  1009.      doesn't contain accented uppercase characters, the accented
  1010.      lowercase characters get transformed into their unaccented
  1011.      counterparts.
  1012.  
  1013. long file names
  1014.      Micro$oft has finally come to their senses and uses a more standard
  1015.      mapping for the long file names. They use Unicode, which is
  1016.      basically a 32 bit version of ASCII. Its first 256 characters are
  1017.      identical to Unix ASCII. Thus, the code page also affects the
  1018.      correspondence between the codes used in long names and those used
  1019.      in short names
  1020.  
  1021.    Mtools considers the filenames entered on the command line as having
  1022. the Unix mapping, and translates the characters to get short names.  By
  1023. default, code page 850 is used with the Swiss uppercase/lowercase
  1024. mapping. I chose this code page, because its set of existing characters
  1025. most closely matches Unix's. Moreover, this code page covers most
  1026. characters in use in the USA, Australia and Western Europe. However, it
  1027. is still possible to chose a different mapping. There are two methods:
  1028. the `country' variable and explicit tables.
  1029.  
  1030. 
  1031. File: mtools.info,  Node: country,  Next: explicit tables,  Prev: why,  Up: character sets
  1032.  
  1033. Configuration using Country
  1034. ---------------------------
  1035.  
  1036.    The `COUNTRY' variable is recommended for people which also have
  1037. access to MS-DOS system files and documentation. If you don't have
  1038. access to these, I'd suggest you'd rather use explicit tables instead.
  1039.  
  1040.    Syntax:
  1041.  
  1042.    `COUNTRY="'COUNTRY`[,['CODEPAGE`],' COUNTRY-FILE`]"'
  1043.  
  1044.    This tells mtools to use a Unix-to-DOS translation table which
  1045. matches CODEPAGE and an lowercase-to-uppercase table for COUNTRY and to
  1046. use the COUNTRY-FILE file to get the lowercase-to-uppercase table. The
  1047. country code is most often the telephone prefix of the country. Refer
  1048. to the DOS help page on "country" for more details. The CODEPAGE and
  1049. the COUNTRY-FILE parameters are optional. Please don't type in the
  1050. square brackets, they are only there to say which parameters are
  1051. optional. The COUNTRY-FILE file is supplied with MS-DOS, and is usually
  1052. called `COUNTRY.SYS', and stored in the `C:\DOS' directory. In most
  1053. cases you don't need it, as the most common translation tables are
  1054. compiled into mtools. So, don't worry if you run a Unix-only box which
  1055. lacks this file.
  1056.  
  1057.    If CODEPAGE is not given, a per country default code page is used.
  1058. If the COUNTRY-FILE parameter isn't given, compiled-in defaults are
  1059. used for the lowercase-to-uppercase table. This is useful for other
  1060. Unices than Linux, which may have no `COUNTRY.SYS' file available
  1061. online.
  1062.  
  1063.    The Unix-to-DOS are not contained in the `COUNTRY.SYS' file, and
  1064. thus mtools always uses compiled-in defaults for those. Thus, only a
  1065. limited amount of code pages are supported. If your preferred code page
  1066. is missing, or if you know the name of the Windows 95 file which
  1067. contains this mapping, could you please drop me a line at
  1068. `alain@linux.lu'.
  1069.  
  1070.    The `COUNTRY' variable can also be set using the environment.
  1071.  
  1072. 
  1073. File: mtools.info,  Node: explicit tables,  Prev: country,  Up: character sets
  1074.  
  1075. Configuration using explicit translation tables
  1076. -----------------------------------------------
  1077.  
  1078.    Translation tables may be described in line in the configuration
  1079. file. Two tables are needed: first the DOS-to-Unix table, and then the
  1080. Lowercase-to-Uppercase table. A DOS-to-Unix table starts with the
  1081. `tounix' keyword, followed by a colon, and 128 hexadecimal numbers.  A
  1082. lower-to-upper table starts with the `fucase' keyword, followed by a
  1083. colon, and 128 hexadecimal numbers.
  1084.  
  1085.    The tables only show the translations for characters whose codes is
  1086. greater than 128, because translation for lower codes is trivial.
  1087.  
  1088.    Example:
  1089.  
  1090.       tounix:
  1091.         0xc7 0xfc 0xe9 0xe2 0xe4 0xe0 0xe5 0xe7
  1092.         0xea 0xeb 0xe8 0xef 0xee 0xec 0xc4 0xc5
  1093.         0xc9 0xe6 0xc6 0xf4 0xf6 0xf2 0xfb 0xf9
  1094.         0xff 0xd6 0xdc 0xf8 0xa3 0xd8 0xd7 0x5f
  1095.         0xe1 0xed 0xf3 0xfa 0xf1 0xd1 0xaa 0xba
  1096.         0xbf 0xae 0xac 0xbd 0xbc 0xa1 0xab 0xbb
  1097.         0x5f 0x5f 0x5f 0x5f 0x5f 0xc1 0xc2 0xc0
  1098.         0xa9 0x5f 0x5f 0x5f 0x5f 0xa2 0xa5 0xac
  1099.         0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0xe3 0xc3
  1100.         0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0x5f 0xa4
  1101.         0xf0 0xd0 0xc9 0xcb 0xc8 0x69 0xcd 0xce
  1102.         0xcf 0x5f 0x5f 0x5f 0x5f 0x7c 0x49 0x5f
  1103.         0xd3 0xdf 0xd4 0xd2 0xf5 0xd5 0xb5 0xfe
  1104.         0xde 0xda 0xd9 0xfd 0xdd 0xde 0xaf 0xb4
  1105.         0xad 0xb1 0x5f 0xbe 0xb6 0xa7 0xf7 0xb8
  1106.         0xb0 0xa8 0xb7 0xb9 0xb3 0xb2 0x5f 0x5f
  1107.      
  1108.       fucase:
  1109.         0x80 0x9a 0x90 0xb6 0x8e 0xb7 0x8f 0x80
  1110.         0xd2 0xd3 0xd4 0xd8 0xd7 0xde 0x8e 0x8f
  1111.         0x90 0x92 0x92 0xe2 0x99 0xe3 0xea 0xeb
  1112.         0x59 0x99 0x9a 0x9d 0x9c 0x9d 0x9e 0x9f
  1113.         0xb5 0xd6 0xe0 0xe9 0xa5 0xa5 0xa6 0xa7
  1114.         0xa8 0xa9 0xaa 0xab 0xac 0xad 0xae 0xaf
  1115.         0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7
  1116.         0xb8 0xb9 0xba 0xbb 0xbc 0xbd 0xbe 0xbf
  1117.         0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc7 0xc7
  1118.         0xc8 0xc9 0xca 0xcb 0xcc 0xcd 0xce 0xcf
  1119.         0xd1 0xd1 0xd2 0xd3 0xd4 0x49 0xd6 0xd7
  1120.         0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf
  1121.         0xe0 0xe1 0xe2 0xe3 0xe5 0xe5 0xe6 0xe8
  1122.         0xe8 0xe9 0xea 0xeb 0xed 0xed 0xee 0xef
  1123.         0xf0 0xf1 0xf2 0xf3 0xf4 0xf5 0xf6 0xf7
  1124.         0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xff
  1125.  
  1126.    The first table maps DOS character codes to Unix character codes. For
  1127. example, the DOS character number 129. This is a u with to dots on top
  1128. of it. To translate it into Unix, we look at the character number 1 in
  1129. the first table (1 = 129 - 128). This is 0xfc. (Beware, numbering
  1130. starts at 0).  The second table maps lower case DOS characters to upper
  1131. case DOS characters. The same lower case u with dots maps to character
  1132. 0x9a, which is an uppercase U with dots in DOS.
  1133.  
  1134. Unicode characters greater than 256
  1135. -----------------------------------
  1136.  
  1137.    If an existing MS-DOS name contains Unicode character greater than
  1138. 256, these are translated to underscores or to characters which are
  1139. close in visual appearance. For example, accented consonants are
  1140. translated into their unaccented counterparts. This translation is used
  1141. for mdir and for the Unix filenames generated by mcopy. Linux does
  1142. support Unicode too, but unfortunately too few applications support it
  1143. yet to bother with it in mtools. Most importantly, xterm can't display
  1144. Unicode yet. If there is sufficient demand, I might include support for
  1145. Unicode in the Unix filenames as well.
  1146.  
  1147.    *Caution:* When deleting files with mtools, the underscore matches
  1148. all characters which can't be represented in Unix. Be careful with mdel!
  1149.  
  1150. 
  1151. File: mtools.info,  Node: parsing order,  Next: old style config,  Prev: character sets,  Up: Configuration
  1152.  
  1153. Location of configuration files and parsing order
  1154. =================================================
  1155.  
  1156.    The configuration files are parsed in the following order:
  1157.   1. compiled-in defaults
  1158.  
  1159.   2. `/usr/freeware/etc/mtools.conf'
  1160.  
  1161.   3. `/etc/mtools' This is for backwards compatibility only, and is
  1162.      only parsed if `mtools.conf' doesn't exist.
  1163.  
  1164.   4. `~/.mtoolsrc'.
  1165.  
  1166.   5. `$MTOOLSRC' (file pointed by the `MTOOLSRC' environmental variable)
  1167.  
  1168.    Options described in the later files override those described in the
  1169. earlier files. Drives defined in earlier files persist if they are not
  1170. overridden in the later files. For instance, drives A and B may be
  1171. defined in `/usr/freeware/etc/mtools.conf' and drives C and D may be
  1172. defined in `~/.mtoolsrc' However, if `~/.mtoolsrc' also defines drive
  1173. A, this new description would override the description of drive A in
  1174. `/usr/freeware/etc/mtools.conf' instead of adding to it. If you want to
  1175. add a new description to a drive already described in an earlier file,
  1176. you need to use either the `+drive' or `drive+' keyword.
  1177.  
  1178. 
  1179. File: mtools.info,  Node: old style config,  Prev: parsing order,  Up: Configuration
  1180.  
  1181. Backwards compatibility with old configuration file syntax
  1182. ==========================================================
  1183.  
  1184.    The syntax described herein is new for version `mtools-3.0'. The old
  1185. line-oriented syntax is still supported. Each line beginning with a
  1186. single letter is considered to be a drive description using the old
  1187. syntax. Old style and new style drive sections may be mixed within the
  1188. same configuration file, in order to make upgrading easier. Support for
  1189. the old syntax will be phased out eventually, and in order to discourage
  1190. its use, I purposefully omit its description here.
  1191.  
  1192. 
  1193. File: mtools.info,  Node: Commands,  Next: Compiling mtools,  Prev: Configuration,  Up: Top
  1194.  
  1195. Command list
  1196. ************
  1197.  
  1198.    This section describes the available mtools commands, and the command
  1199. line parameters that each of them accepts. Options which are common to
  1200. all mtools commands are not described here, *Note arguments:: for a
  1201. description of those.
  1202.  
  1203. * Menu:
  1204.  
  1205. * floppyd::           floppy daemon to run on your X server box
  1206. * mattrib::           change MS-DOS file attribute flags
  1207. * mbadblocks::        tests a floppy disk, and marks the bad blocks in the FAT
  1208. * mcd::               change MS-DOS directory
  1209. * mcopy::             copy MS-DOS files to/from Unix
  1210. * mdel::              delete an MS-DOS file
  1211. * mdeltree::          recursively delete an MS-DOS directory
  1212. * mdir::              display an MS-DOS directory
  1213. * mdu::               list space occupied by directory and its contents
  1214. * mformat::           add an MS-DOS filesystem to a low-level formatted floppy disk
  1215. * minfo::             get information about an MS-DOS filesystem.
  1216. * mlabel::            make an MS-DOS volume label
  1217. * mkmanifest::        makes a list of short name equivalents
  1218. * mmd::               make an MS-DOS subdirectory
  1219. * mmount::            mount an MS-DOS disk
  1220. * mpartition::        create an MS-DOS as a partition
  1221. * mrd::               remove an MS-DOS subdirectory
  1222. * mmove::             move or rename an MS-DOS file or subdirectory
  1223. * mren::              rename an existing MS-DOS file
  1224. * mshowfat::          shows the FAT map of a file
  1225. * mtoolstest::        tests and displays the configuration
  1226. * mtype::             display contents of an MS-DOS file
  1227. * mzip::              zip disk specific commands
  1228. * xcopy::             recursively copy a dos directory into another
  1229.  
  1230. 
  1231. File: mtools.info,  Node: floppyd,  Next: mattrib,  Prev: Commands,  Up: Commands
  1232.  
  1233. Floppyd
  1234. =======
  1235.  
  1236.    `Floppyd' is used as a server to grant access to the floppy drive to
  1237. clients running on a remote machine, just as an X server grants access
  1238. to the display to remote clients.  It has the following syntax:
  1239.  
  1240.    `floppyd' [`-d'] [`-l'] [`-s' PORT] [`-r' USER] [`-b' IPADDR]
  1241. DEVICENAME [DISPLAYNAMES]
  1242.  
  1243.    `floppyd' is always associated with an X server.  It runs on the
  1244. same machine as its X server, and listens on port 5703 and above.
  1245.  
  1246. Authentication
  1247. --------------
  1248.  
  1249.    `floppyd' authenticates remote clients using the `Xauthority'
  1250. protocol. Xhost authentication is not supported. Each floppyd is
  1251. associated with an X server.  When a remote client attempts to connect
  1252. to floppyd, it sends floppyd the X authority record corresponding to
  1253. floppyd's X server.  Floppyd in turn then tries to open up a connection
  1254. to the X server in order to verify the authenticity of the xauth record.
  1255. If the connection to the X server succeeds, the client is granted access
  1256.  
  1257.    *Caution*: In order to make authentication work correctly, the local
  1258. host should *not* be listed in the `xhost' list of allowed hosts.
  1259. Indeed, hosts listed in `xhost' do not need a correct `Xauthority'
  1260. cookie to connect to the X server. As `floppyd' runs on the same host
  1261. as the X server, all its probe connection would succeed even for
  1262. clients who supplied a bad cookie.  This means that your floppy drive
  1263. would be open to the world, i.e. a huge security hole.   If your X
  1264. server does not allow you to remove `localhost:0' and `:0' from the
  1265. `xhost' list, you can prevent floppyd from probing those display names
  1266. with the `-l' option.
  1267.  
  1268. Command line options
  1269. --------------------
  1270.  
  1271. `d'
  1272.      Daemon mode. Floppyd runs its own server loop.  Do not supply this
  1273.      if you start floppyd from `inetd.conf'
  1274.  
  1275. `s  PORT'
  1276.      Port number for deamon mode.  Default is 5703 + DISPLAYNUMBER.
  1277.      This flag implies daemon mode.  For example, for display
  1278.      `hitchhiker:5', the port would be 5708.
  1279.  
  1280. `b  IPADDR'
  1281.      Bind address (for multihomed hosts). This flag implies daemon mode
  1282.  
  1283. `r USER'
  1284.      Run the server under as the given user
  1285.  
  1286. `l'
  1287.      Do not generate local default display names
  1288.  
  1289.    DEVICENAME is the name of the device node to be opened.  Default is
  1290. `/dev/fd0'.
  1291.  
  1292.    DISPLAYNAMES is a list of display names to connect to for
  1293. authentication.  All displays in the list are tried until one is found
  1294. that grants access or until the list is exhausted.  If no list is
  1295. supplied, the a display name list based on the ip address supplied using
  1296. the `-b' flag is constructed:
  1297.      `IPADDR:N.0'.
  1298.  
  1299.    * `:'N`.0'  If `floppyd' is started from inetd, the address of the
  1300. socket used for stdin is used as a bind address.
  1301.  
  1302.    If no bind address is supplied, a list containing the following 3
  1303. items is constructed:
  1304.    * HOSTNAME`:'N`.0'
  1305.  
  1306.    * `localhost:'N`.0'
  1307.  
  1308.    * `:'N`.0'
  1309.  
  1310.    N is the display number derived from the port number (PORT - 5703
  1311. modulo 10). The local items (`localhost:0' and `:0') are not
  1312. constructed if the `-l' flag is given.
  1313.  
  1314. Connecting to floppyd
  1315. ---------------------
  1316.  
  1317.    In order to use floppyd, add the flag `remote' to the device
  1318. description in your `~/.mtoolsrc' file.  If the flag `remote' is given,
  1319. the `file' parameter of the device description is taken to be a remote
  1320. address.  It's format is the following:
  1321. HOSTNAME`:'DISPLAYNUMBER[`/'BASEPORT]. When using this entry, mtools
  1322. connects to port BASEPORT+DISPLAYNUMBER at HOSTNAME. By default
  1323. BASEPORT is 5703.
  1324.  
  1325. Examples:
  1326. ---------
  1327.  
  1328.    The following starts a floppy daemon giving access to `/dev/fd0',
  1329. listening on the default port 5703, tied to the default X servers:
  1330.  
  1331.      floppyd -d /dev/fd0
  1332.  
  1333.    Each of the following starts a floppy daemon giving access to
  1334. `/dev/fd1', tied to the :1 local X servers, and listening on port 5704.
  1335. We assume that the local host is named `hitchhiker'.
  1336.  
  1337.      floppyd -d /dev/fd0 localhost:1 hitchhiker:1 :1
  1338.      floppyd -p 5704 /dev/fd0
  1339.  
  1340.    If you want to start floppyd by `inetd' instead of running it as a
  1341. daemon, insert the following lines into `/etc/services':
  1342.      # floppy daemon
  1343.      floppyd-0    5703/tcp    # floppy daemon for X server :0
  1344.      floppyd-1    5704/tcp    # floppy daemon for X server :1
  1345.  
  1346.    And insert the following into `/etc/inetd.conf' (assuming that you
  1347. have defined a user named floppy in your `/etc/passwd'):
  1348.  
  1349.      # floppy daemon
  1350.      floppyd-0   stream  tcp  wait  floppy  /usr/sbin/floppyd floppyd /dev/fd0
  1351.      floppyd-1   stream  tcp  wait  floppy  /usr/sbin/floppyd floppyd /dev/fd1
  1352.  
  1353.    Note that you need to supply the X display names for the second
  1354. floppyd.  This is because the port is opened by inetd.conf, and hence
  1355. floppyd cannot know its number to interfere the display number.
  1356.  
  1357.    On the client side, insert the following into your `~/.mtoolsrc' to
  1358. define a drive letter accessing floppy drive in your X terminal:
  1359.      drive x: file="$DISPLAY" remote
  1360.  
  1361. 
  1362. File: mtools.info,  Node: mattrib,  Next: mbadblocks,  Prev: floppyd,  Up: Commands
  1363.  
  1364. Mattrib
  1365. =======
  1366.  
  1367.    `Mattrib' is used to change MS-DOS file attribute flags. It has the
  1368. following syntax:
  1369.  
  1370.    `mattrib' [`-a|+a'] [`-h|+h'] [`-r|+r'] [`-s|+s'] [`-/']  [`-X']
  1371. MSDOSFILE [ MSDOSFILES ... ]
  1372.  
  1373.    `Mattrib' adds attribute flags to an MS-DOS file (with the ``+''
  1374. operator) or remove attribute flags (with the ``-'' operator).
  1375.  
  1376.    `Mattrib' supports the following attribute bits:
  1377.  
  1378. `a'
  1379.      Archive bit.  Used by some backup programs to indicate a new file.
  1380.  
  1381. `r'
  1382.      Read-only bit.  Used to indicate a read-only file.  Files with
  1383.      this bit set cannot be erased by `DEL' nor modified.
  1384.  
  1385. `s'
  1386.      System bit.  Used by MS-DOS to indicate a operating system file.
  1387.  
  1388. `h'
  1389.      Hidden bit.  Used to make files hidden from `DIR'.
  1390.  
  1391.    `Mattrib' supports the following command line flags:
  1392. `/'
  1393.      Recursive.  Recursively list the attributes of the files in the
  1394.      subdirectories.
  1395.  
  1396. `X'
  1397.      Concise. Prints the attributes whithout any whitespace padding.
  1398.      This is convenient for script.  If neither the "/" option is
  1399.      given, nor the MSDOSFILE contains a wildcard, and there is only
  1400.      one Msdos file parameter on the command line, only the attribute
  1401.      is printed, and not the filename.  This option is convenient for
  1402.      scripts
  1403.  
  1404. 
  1405. File: mtools.info,  Node: mbadblocks,  Next: mcd,  Prev: mattrib,  Up: Commands
  1406.  
  1407. Mbadblocks
  1408. ==========
  1409.  
  1410.    The `mbadblocks' command is used to scan an MS-DOS floppy and mark
  1411. its unused bad blocks as bad. It uses the following syntax:
  1412.  
  1413.    `mbadblocks' DRIVE`:'
  1414.  
  1415.    `Mbadblocks' scans an MS-DOS floppy for bad blocks. All unused bad
  1416. blocks are marked as such in the FAT. This is intended to be used right
  1417. after `mformat'.  It is not intended to salvage bad disks.
  1418.  
  1419. Bugs
  1420. ----
  1421.  
  1422.    `Mbadblocks' should (but doesn't yet :-( ) also try to salvage bad
  1423. blocks which are in use by reading them repeatedly, and then mark them
  1424. bad.
  1425.  
  1426. 
  1427. File: mtools.info,  Node: mcd,  Next: mcopy,  Prev: mbadblocks,  Up: Commands
  1428.  
  1429. Mcd
  1430. ===
  1431.  
  1432.    The `mcd' command is used to change the mtools working directory on
  1433. the MS-DOS disk. It uses the following syntax:
  1434.  
  1435.      `mcd' [MSDOSDIRECTORY]
  1436.  
  1437.    Without arguments, `mcd' reports the current device and working
  1438. directory.  Otherwise, `mcd' changes the current device and current
  1439. working directory relative to an MS-DOS filesystem.
  1440.  
  1441.    The environmental variable `MCWD' may be used to locate the file
  1442. where the device and current working directory information is stored.
  1443. The default is `$HOME/.mcwd'.  Information in this file is ignored if
  1444. the file is more than 6 hours old.
  1445.  
  1446.    `Mcd' returns 0 on success or 1 on failure.
  1447.  
  1448.    Unlike MS-DOS versions of `CD', `mcd' can be used to change to
  1449. another device. It may be wise to remove old `.mcwd' files at logout.
  1450.  
  1451. 
  1452. File: mtools.info,  Node: mcopy,  Next: mdel,  Prev: mcd,  Up: Commands
  1453.  
  1454. Mcopy
  1455. =====
  1456.  
  1457.    The `mcopy' command is used to copy MS-DOS files to and from Unix.
  1458. It uses the following syntax:
  1459.  
  1460.      `mcopy' [`-b/ptnvmoQOsSrRA'] SOURCEFILE TARGETFILE
  1461.      `mcopy' [`-b/ptnvmoQOsSrRA'] SOURCEFILE [ SOURCEFILES... ] TARGETDIRECTORY
  1462.      `mcopy' [`-tnvm'] MSDOSSOURCEFILE
  1463.  
  1464.    `Mcopy' copies the specified file to the named file, or copies
  1465. multiple files to the named directory.  The source and target can be
  1466. either MS-DOS or Unix files.
  1467.  
  1468.    The use of a drive letter designation on the MS-DOS files, 'a:' for
  1469. example, determines the direction of the transfer.  A missing drive
  1470. designation implies a Unix file whose path starts in the current
  1471. directory.  If a source drive letter is specified with no attached file
  1472. name (e.g. `mcopy a: .'), all files are copied from that drive.
  1473.  
  1474.    If only a single, MS-DOS source parameter is provided (e.g. "mcopy
  1475. a:foo.exe"), an implied destination of the current directory (``.'') is
  1476. assumed.
  1477.  
  1478.    A filename of ``-'' means standard input or standard output,
  1479. depending on its position on the command line.
  1480.  
  1481.    `Mcopy' accepts the following command line options:
  1482.  
  1483. `b'
  1484.      Batch mode. Optimized for huge recursive copies, but less secure
  1485.      if a crash happens during the copy.
  1486.  
  1487. `/'
  1488.      Recursive copy.  Also copies directories and their contents
  1489.  
  1490. `p'
  1491.      Preserves the attributes of the copied files
  1492.  
  1493. `Q'
  1494.      When mcopying multiple files, quits as soon as one copy fails (for
  1495.      example due to lacking storage space on the target disk)
  1496.  
  1497. `t'
  1498.      Text file transfer.  `Mcopy' translates incoming carriage
  1499.      return/line feeds to line feeds.
  1500.  
  1501. `n'
  1502.      No confirmation when overwriting Unix files.  `Mcopy' doesn't warn
  1503.      the user when overwriting an existing Unix file.  In order to
  1504.      switch off confirmation for DOS files, use `-o'.
  1505.  
  1506. `m'
  1507.      Preserve the file modification time. If the target file already
  1508.      exists, and the `-n' option is not in effect, `mcopy' asks whether
  1509.      to overwrite the file or to rename the new file (*Note name
  1510.      clashes::) for details).
  1511.  
  1512. Bugs
  1513. ----
  1514.  
  1515.    Unlike MS-DOS, the '+' operator (append) from MS-DOS is not
  1516. supported. However, you may use `mtype' to produce the same effect:
  1517.      mtype a:file1 a:file2 a:file3 >unixfile
  1518.      mtype a:file1 a:file2 a:file3 | mcopy - a:msdosfile
  1519.  
  1520. 
  1521. File: mtools.info,  Node: mdel,  Next: mdeltree,  Prev: mcopy,  Up: Commands
  1522.  
  1523. Mdel
  1524. ====
  1525.  
  1526.    The `mdel' command is used to delete an MS-DOS file. Its syntax is:
  1527.  
  1528.      `mdel' [`-v'] MSDOSFILE [ MSDOSFILES ...  ]
  1529.  
  1530.    `Mdel' deletes files on an MS-DOS filesystem.
  1531.  
  1532.    `Mdel' asks for verification prior to removing a read-only file.
  1533.  
  1534. 
  1535. File: mtools.info,  Node: mdeltree,  Next: mdir,  Prev: mdel,  Up: Commands
  1536.  
  1537. Mdeltree
  1538. ========
  1539.  
  1540.    The `mdeltree' command is used to delete an MS-DOS file. Its syntax
  1541. is:
  1542.  
  1543.      `mdeltree' [`-v'] MSDOSDIRECTORY [MSDOSDIRECTORIES...]
  1544.  
  1545.    `Mdeltree' removes a directory and all the files and subdirectories
  1546. it contains from an MS-DOS filesystem. An error occurs if the directory
  1547. to be removed does not exist.
  1548.  
  1549. 
  1550. File: mtools.info,  Node: mdir,  Next: mdu,  Prev: mdeltree,  Up: Commands
  1551.  
  1552. Mdir
  1553. ====
  1554.  
  1555.    The `mdir' command is used to display an MS-DOS directory. Its
  1556. syntax is:
  1557.  
  1558.    `mdir' [`-/'] [`-f'] [`-w'] [`-a'] [`-X'] MSDOSFILE [ MSDOSFILES...]
  1559.  
  1560.    `Mdir' displays the contents of MS-DOS directories, or the entries
  1561. for some MS-DOS files.
  1562.  
  1563.    `Mdir' supports the following command line options:
  1564.  
  1565. `/'
  1566.      Recursive output, just like Dos' `-s' option
  1567.  
  1568. `w'
  1569.      Wide output.  With this option, `mdir' prints the filenames across
  1570.      the page without displaying the file size or creation date.
  1571.  
  1572. `a'
  1573.      Also list hidden files.
  1574.  
  1575. `f'
  1576.      Fast.  Do not try to find out free space.  On larger disks,
  1577.      finding out the amount of free space takes up some non trivial
  1578.      amount of time, as the whole FAT must be read in and scanned.  The
  1579.      `-f' flag bypasses this step.  This flag is not needed on FAT32
  1580.      filesystems, which store the size explicitely.
  1581.  
  1582. `X'
  1583.      Concise listing.  List only a newline separated list of pathnames
  1584.      without any decoration nor additional information
  1585.  
  1586.    An error occurs if a component of the path is not a directory.
  1587.  
  1588. 
  1589. File: mtools.info,  Node: mdu,  Next: mformat,  Prev: mdir,  Up: Commands
  1590.  
  1591.    Commands
  1592.  
  1593. Mdu
  1594. ===
  1595.  
  1596.    `Mdu' is used to list the space occupied by a directory, its
  1597. subdirectories and its files. It is similar to the `du' command on
  1598. Unix.  The unit used are clusters.  Use the minfo command to find out
  1599. the cluster size.
  1600.  
  1601.    `mdu' [`-a'] [ MSDOSFILES ... ]
  1602.  
  1603. `a'
  1604.      All files.  List also the space occupied for individual files.
  1605.  
  1606. `s'
  1607.      Only list the total space, don't give details for each
  1608.      subdirectory.
  1609.  
  1610. 
  1611. File: mtools.info,  Node: mformat,  Next: mkmanifest,  Prev: mdu,  Up: Commands
  1612.  
  1613. Mformat
  1614. =======
  1615.  
  1616.    The `mformat' command is used to add an MS-DOS filesystem to a
  1617. low-level formatted diskette. Its syntax is:
  1618.  
  1619.      `mformat' [`-t' CYLINDERS] [`-h' HEADS]
  1620.      [`-s' SECTORS] [`-l' VOLUME_LABEL] [`-F']
  1621.      [`-I' FSVERSION] [`-S' SIZECODE] [`-2'
  1622.      SECTORS_ON_TRACK_0] [`-M' SOFTWARE_SECTOR_SIZE]
  1623.      [`-a'] [`-X'] [`-C'] [`-H' HIDDEN_SECTORS]
  1624.      [`-r' ROOT_SECTORS] [`-B' BOOT_SECTOR]
  1625.      [`-0' RATE_ON_TRACK_0] [`-A' RATE_ON_OTHER_TRACKS]
  1626.      [`-1']
  1627.      [`-k'] DRIVE:
  1628.  
  1629.    `Mformat' adds a minimal MS-DOS filesystem (boot sector, FAT, and
  1630. root directory) to a diskette that has already been formatted by a Unix
  1631. low-level format.
  1632.  
  1633.    The following options are supported: (The S, 2, 1 and M options may
  1634. not exist if this copy of mtools has been compiled without the USE_2M
  1635. option)
  1636.  
  1637. `t'
  1638.      The number of cylinders.
  1639.  
  1640. `h'
  1641.      The number of heads (sides).
  1642.  
  1643. `s'
  1644.      The number of sectors per track. If the 2m option is given, number
  1645.      of 512-byte sector equivalents on generic tracks (i.e. not head 0
  1646.      track 0).  If the 2m option is not given, number of physical
  1647.      sectors per track (which may be bigger than 512 bytes).
  1648.  
  1649. `l'
  1650.      An optional volume label.
  1651.  
  1652. `S'
  1653.      The sizecode. The size of the sector is 2 ^ (sizecode + 7).
  1654.  
  1655. `2'
  1656.      2m format. The parameter to this option describes the number of
  1657.      sectors on track 0, head 0. This option is recommended for sectors
  1658.      bigger than normal.
  1659.  
  1660. `1'
  1661.      don't use a 2m format, even if the current geometry of the disk is
  1662.      a 2m geometry.
  1663.  
  1664. `M'
  1665.      software sector size. This parameter describes the sector size in
  1666.      bytes used by the MS-DOS filesystem. By default it is the physical
  1667.      sector size.
  1668.  
  1669. `a'
  1670.      If this option is given, an Atari style serial number is generated.
  1671.      Ataris store their serial number in the OEM label.
  1672.  
  1673. `X'
  1674.      formats the disk as an XDF disk. *Note XDF:: for more details. The
  1675.      disk has first to be low-level formatted using the xdfcopy utility
  1676.      included in the fdutils package.
  1677.  
  1678. `C'
  1679.      creates the disk image file to install the MS-DOS filesystem on
  1680.      it. Obviously, this is useless on physical devices such as floppies
  1681.      and hard disk partitions.
  1682.  
  1683. `H'
  1684.      number of hidden sectors. This parameter is useful for formatting
  1685.      hard disk partition, which are not aligned on track boundaries
  1686.      (i.e. first head of first track doesn't belong to the partition,
  1687.      but contains a partition table). In that case the number of hidden
  1688.      sectors is in general the number of sectors per cylinder. This is
  1689.      untested.
  1690.  
  1691. `n'
  1692.      serial number
  1693.  
  1694. `F'
  1695.      Format the partition as FAT32 (experimental).
  1696.  
  1697. `I'
  1698.      Sets the fsVersion id when formatting a FAT32 drive.  In order to
  1699.      find this out, run minfo on an existing FAT32 drive, and mail me
  1700.      about it, so I can include the correct value in future versions of
  1701.      mtools.
  1702.  
  1703. `c'
  1704.      Sets the size of a cluster (in sectors).  If this cluster size
  1705.      would generate a FAT that too big for its number of bits, mtools
  1706.      automatically increases the cluster size, until the FAT is small
  1707.      enough.
  1708.  
  1709. `r'
  1710.      Sets the size of the root directory (in sectors).  Only applicable
  1711.      to 12 and 16 bit FATs.
  1712.  
  1713. `B'
  1714.      Use the bootsector stored in the given file or device, instead of
  1715.      using its own.  Only the geometry fields are updated to match the
  1716.      target disks parameters.
  1717.  
  1718. `k'
  1719.      Keep the existing boot sector as much as possible.  Only the
  1720.      geometry fields are updated to match the target disks parameters.
  1721.  
  1722. `0'
  1723.      Data transfer rate on track 0
  1724.  
  1725. `A'
  1726.      Data transfer rate on tracks other than 0
  1727.  
  1728.    To format a diskette at a density other than the default, you must
  1729. supply (at least) those command line parameters that are different from
  1730. the default.
  1731.  
  1732.    `Mformat' returns 0 on success or 1 on failure.
  1733.  
  1734.    It doesn't record bad block information to the Fat, use `mkmanifest'
  1735. for that.
  1736.  
  1737. 
  1738. File: mtools.info,  Node: mkmanifest,  Next: minfo,  Prev: mformat,  Up: Commands
  1739.  
  1740. Mkmanifest
  1741. ==========
  1742.  
  1743.    The `mkmanifest' command is used to create a shell script (packing
  1744. list) to restore Unix filenames. Its syntax is:
  1745.  
  1746.    `mkmanifest' [ FILES ]
  1747.  
  1748.    `Mkmanifest' creates a shell script that aids in the restoration of
  1749. Unix filenames that got clobbered by the MS-DOS filename restrictions.
  1750. MS-DOS filenames are restricted to 8 character names, 3 character
  1751. extensions, upper case only, no device names, and no illegal characters.
  1752.  
  1753.    The mkmanifest program is compatible with the methods used in
  1754. `pcomm, arc,' and `mtools' to change perfectly good Unix filenames to
  1755. fit the MS-DOS restrictions. This command is only useful if the target
  1756. system which will read the diskette cannot handle vfat long names.
  1757.  
  1758. Example
  1759. -------
  1760.  
  1761.    You want to copy the following Unix files to a MS-DOS diskette
  1762. (using the `mcopy' command).
  1763.  
  1764.        very_long_name
  1765.        2.many.dots
  1766.        illegal:
  1767.        good.c
  1768.        prn.dev
  1769.        Capital
  1770.  
  1771.    `Mcopy' converts the names to:
  1772.  
  1773.        very_lon
  1774.        2xmany.dot
  1775.        illegalx
  1776.        good.c
  1777.        xprn.dev
  1778.        capital
  1779.  
  1780.    The command:
  1781.      mkmanifest very_long_name 2.many.dots illegal: good.c prn.dev Capital >manifest
  1782.    would produce the following:
  1783.        mv very_lon very_long_name
  1784.        mv 2xmany.dot 2.many.dots
  1785.        mv illegalx illegal:
  1786.        mv xprn.dev prn.dev
  1787.        mv capital Capital
  1788.  
  1789.    Notice that "good.c" did not require any conversion, so it did not
  1790. appear in the output.
  1791.  
  1792.    Suppose I've copied these files from the diskette to another Unix
  1793. system, and I now want the files back to their original names.  If the
  1794. file "manifest" (the output captured above) was sent along with those
  1795. files, it could be used to convert the filenames.
  1796.  
  1797. Bugs
  1798. ----
  1799.  
  1800.    The short names generated by `mkmanifest' follow the old convention
  1801. (from mtools-2.0.7) and not the one from Windows 95 and mtools-3.0.
  1802.  
  1803. 
  1804. File: mtools.info,  Node: minfo,  Next: mlabel,  Prev: mkmanifest,  Up: Commands
  1805.  
  1806. Minfo
  1807. =====
  1808.  
  1809.    The `minfo' command prints the parameters of a Dos filesystem, such
  1810. as number of sectors, heads and cylinders.  It also prints an mformat
  1811. command line which can be used to create a similar Dos filesystem on
  1812. another media.  However, this doesn't work with 2m or Xdf media, and
  1813. with Dos 1.0 filesystems
  1814.      `minfo' DRIVE:
  1815.  
  1816.    Mlabel supports the following option:
  1817. `v'
  1818.      Prints a hexdump of the bootsector, in addition to the other
  1819.      information
  1820.  
  1821. 
  1822. File: mtools.info,  Node: mlabel,  Next: mmd,  Prev: minfo,  Up: Commands
  1823.  
  1824. Mlabel
  1825. ======
  1826.  
  1827.    The `mlabel' command adds a volume label to a disk. Its syntax is:
  1828.      `mlabel' [`-vcs'] DRIVE:[NEW_LABEL]
  1829.  
  1830.    `Mlabel' displays the current volume label, if present. If NEW_LABEL
  1831. is not given, and if neither the `c' nor the `s' options are set, it
  1832. prompts the user for a new volume label.  To delete an existing volume
  1833. label, press return at the prompt.
  1834.  
  1835.    Reasonable care is taken to create a valid MS-DOS volume label.  If
  1836. an invalid label is specified, `mlabel' changes the label (and displays
  1837. the new label if the verbose mode is set). `Mlabel' returns 0 on
  1838. success or 1 on failure.
  1839.  
  1840.    Mlabel supports the following options:
  1841. `c'
  1842.      Clears an existing label, without prompting the user
  1843.  
  1844. `s'
  1845.      Shows the existing label, without prompting the user.
  1846.  
  1847. 
  1848. File: mtools.info,  Node: mmd,  Next: mmount,  Prev: mlabel,  Up: Commands
  1849.  
  1850. Mmd
  1851. ===
  1852.  
  1853.    The `mmd' command is used to make an MS-DOS subdirectory. Its syntax
  1854. is:
  1855.  
  1856.    `mmd' [`-voOsSrRA'] MSDOSDIRECTORY [ MSDOSDIRECTORIES... ]
  1857.  
  1858.    `Mmd' makes a new directory on an MS-DOS filesystem. An error occurs
  1859. if the directory already exists.
  1860.  
  1861. 
  1862. File: mtools.info,  Node: mmount,  Next: mmove,  Prev: mmd,  Up: Commands
  1863.  
  1864. Mmount
  1865. ======
  1866.  
  1867.    The `mmount' command is used to mount an MS-DOS disk. It is only
  1868. available on Linux, as it is only useful if the OS kernel allows to
  1869. configure the disk geometry. Its syntax is:
  1870.  
  1871.    `mmount' MSDOSDRIVE [MOUNTARGS]
  1872.  
  1873.    `Mmount' reads the boot sector of an MS-DOS disk, configures the
  1874. drive geometry, and finally mounts it passing `mountargs' to `mount. '
  1875. If no mount arguments are specified, the name of the device is used. If
  1876. the disk is write protected, it is automatically mounted read only.
  1877.  
  1878. 
  1879. File: mtools.info,  Node: mmove,  Next: mpartition,  Prev: mmount,  Up: Commands
  1880.  
  1881. Mmove
  1882. =====
  1883.  
  1884.    The `mmove' command is used to moves or renames an existing MS-DOS
  1885. file or subdirectory.
  1886.      `mmove' [`-voOsSrRA'] SOURCEFILE TARGETFILE
  1887.      `mmove' [`-voOsSrRA'] SOURCEFILE [ SOURCEFILES... ] TARGETDIRECTORY
  1888.    `Mmove' moves or renames an existing MS-DOS file or subdirectory.
  1889. Unlike the MS-DOS version of `MOVE', `mmove' is able to move
  1890. subdirectories.  Files or directories can only be moved within one
  1891. filesystem. Data cannot be moved from Dos to Unix or vice-versa.  If
  1892. you omit the drive letter from the target file or directory, the same
  1893. letter as for the source is assumed.  If you omit the drive letter from
  1894. all parameters, drive a: is assumed by default.
  1895.  
  1896. 
  1897. File: mtools.info,  Node: mpartition,  Next: mrd,  Prev: mmove,  Up: Commands
  1898.  
  1899. Mpartition
  1900. ==========
  1901.  
  1902.    The `mpartition' command is used to create MS-DOS filesystems as
  1903. partitions.  This is intended to be used on non-Linux systems, i.e.
  1904. systems where fdisk and easy access to Scsi devices are not available.
  1905. This command only works on drives whose partition variable is set.
  1906.  
  1907.      `mpartition' `-p' DRIVE
  1908.      `mpartition' `-r' DRIVE
  1909.      `mpartition' `-I' DRIVE
  1910.      `mpartition' `-a' DRIVE
  1911.      `mpartition' `-d' DRIVE
  1912.      `mpartition' `-c' [`-s' SECTORS] [`-h' HEADS]
  1913.      [`-t' CYLINDERS] [`-v' [`-T' TYPE] [`-b'
  1914.      BEGIN] [`-l' length] [`-f']
  1915.  
  1916.    Mpartition supports the following operations:
  1917.  
  1918. `p'
  1919.      Prints a command line to recreate the partition for the drive.
  1920.      Nothing is printed if the partition for the drive is not defined,
  1921.      or an inconsistency has been detected.  If verbose (`-v') is also
  1922.      set, prints the current partition table.
  1923.  
  1924. `r'
  1925.      Removes the partition described by DRIVE.
  1926.  
  1927. `I'
  1928.      Initializes the partition table, and removes all partitions.
  1929.  
  1930. `c'
  1931.      Creates the partition described by DRIVE.
  1932.  
  1933. `a'
  1934.      "Activates" the partition, i.e. makes it bootable.  Only one
  1935.      partition can be bootable at a time.
  1936.  
  1937. `d'
  1938.      "Desactivates" the partition, i.e. makes it unbootable.
  1939.  
  1940.    If no operation is given, the current settings are printed.
  1941.  
  1942.    For partition creations, the following options are available:
  1943. `s SECTORS'
  1944.      The number of sectors per track of the partition (which is also the
  1945.      number of sectors per track for the whole drive).
  1946.  
  1947. `h HEADS'
  1948.      The number of heads of the partition (which is also the number of
  1949.      heads for the whole drive).  By default, the geometry information
  1950.      (number of sectors and heads) is figured out from neighbouring
  1951.      partition table entries, or guessed from the size.
  1952.  
  1953. `t CYLINDERS'
  1954.      The number of cylinders of the partition (not the number of
  1955.      cylinders of the whole drive.
  1956.  
  1957. `b BEGIN'
  1958.      The starting offset of the partition, expressed in sectors. If
  1959.      begin is not given, mpartition lets the partition begin at the
  1960.      start of the disk (partition number 1), or immediately after the
  1961.      end of the previous partition.
  1962.  
  1963. `l LENGTH'
  1964.      The size (length) of the partition, expressed in sectors.  If end
  1965.      is not given, mpartition figures out the size from the number of
  1966.      sectors, heads and cylinders.  If these are not given either, it
  1967.      gives the partition the biggest possible size, considering disk
  1968.      size and start of the next partition.
  1969.  
  1970.    The following option is available for all operation which modify the
  1971. partition table:
  1972. `f'
  1973.      Usually, before writing back any changes to the partition,
  1974.      mpartition performs certain consistenct checks, such as checking
  1975.      for overlaps and proper alignment of the partitions.  If any of
  1976.      these checks fails, the partition table is not changes.  The `-f'
  1977.      allows you to override these safeguards.
  1978.  
  1979.    The following option is available for all operations:
  1980. `v'
  1981.      Together with `-p' prints the partition table as it is now (no
  1982.      change operation), or as it is after it is modified.
  1983.  
  1984. `vv'
  1985.      If the verbosity flag is given twice, mpartition will print out a
  1986.      hexdump of the partition table when reading it from and writing it
  1987.      to the device.
  1988.  
  1989. 
  1990. File: mtools.info,  Node: mrd,  Next: mren,  Prev: mpartition,  Up: Commands
  1991.  
  1992. Mrd
  1993. ===
  1994.  
  1995.    The `mrd' command is used to remove an MS-DOS subdirectory. Its
  1996. syntax is:
  1997.  
  1998.      `mrd' [`-v'] MSDOSDIRECTORY [ MSDOSDIRECTORIES... ]
  1999.  
  2000.    `Mrd' removes a directory from an MS-DOS filesystem. An error occurs
  2001. if the directory does not exist or is not empty.
  2002.  
  2003. 
  2004. File: mtools.info,  Node: mren,  Next: mshowfat,  Prev: mrd,  Up: Commands
  2005.  
  2006. Mren
  2007. ====
  2008.  
  2009.    The `mren' command is used to rename or move an existing MS-DOS file
  2010. or subdirectory. Its syntax is:
  2011.  
  2012.      `mren' [`-voOsSrRA'] SOURCEFILE TARGETFILE
  2013.  
  2014.    `Mren' renames an existing file on an MS-DOS filesystem.
  2015.  
  2016.    In verbose mode, `Mren' displays the new filename if the name
  2017. supplied is invalid.
  2018.  
  2019.    If the first syntax is used (only one sourcefile), and if the target
  2020. name doesn't contain any slashes or colons, the file (or subdirectory)
  2021. is renamed in the same directory, instead of being moved to the current
  2022. `mcd' directory as would be the case with `mmove'. Unlike the MS-DOS
  2023. version of `REN', `mren' can be used to rename directories.
  2024.  
  2025. 
  2026. File: mtools.info,  Node: mshowfat,  Next: mtoolstest,  Prev: mren,  Up: Commands
  2027.  
  2028. Mshowfat
  2029. ========
  2030.  
  2031.    The `mshowfat' command is used to display the FAT entries for a
  2032. file.  Syntax:
  2033.  
  2034.      `$ mshowfat files'
  2035.  
  2036. 
  2037. File: mtools.info,  Node: mtoolstest,  Next: mtype,  Prev: mshowfat,  Up: Commands
  2038.  
  2039. Mtoolstest
  2040. ==========
  2041.  
  2042.    The `mtoolstest' command is used to tests the mtools configuration
  2043. files. To invoke it, just type `mtoolstest' without any arguments.
  2044. `Mtoolstest' reads the mtools configuration files, and prints the
  2045. cumulative configuration to `stdout'. The output can be used as a
  2046. configuration file itself (although you might want to remove redundant
  2047. clauses).  You may use this program to convert old-style configuration
  2048. files into new style configuration files.
  2049.  
  2050. 
  2051. File: mtools.info,  Node: mtype,  Next: mzip,  Prev: mtoolstest,  Up: Commands
  2052.  
  2053. Mtype
  2054. =====
  2055.  
  2056.    The `mtype' command is used to display contents of an MS-DOS file.
  2057. Its syntax is:
  2058.  
  2059.      `mtype' [`-ts'] MSDOSFILE [ MSDOSFILES... ]
  2060.  
  2061.    `Mtype' displays the specified MS-DOS file on the screen.
  2062.  
  2063.    In addition to the standard options, `Mtype' allows the following
  2064. command line options:
  2065.  
  2066. `t'
  2067.      Text file viewing.  `Mtype' translates incoming carriage
  2068.      return/line feeds to line feeds.
  2069.  
  2070. `s'
  2071.      `Mtype' strips the high bit from the data.
  2072.  
  2073.    The `mcd' command may be used to establish the device and the
  2074. current working directory (relative to MS-DOS), otherwise the default is
  2075. `A:/'.
  2076.  
  2077.    `Mtype' returns 0 on success, 1 on utter failure, or 2 on partial
  2078. failure.
  2079.  
  2080.    Unlike the MS-DOS version of `TYPE', `mtype' allows multiple
  2081. arguments.
  2082.  
  2083. 
  2084. File: mtools.info,  Node: mzip,  Next: xcopy,  Prev: mtype,  Up: Commands
  2085.  
  2086. Mzip
  2087. ====
  2088.  
  2089.    The `mzip' command is used to issue ZIP disk specific commands on
  2090. Solaris or HPUX. Its syntax is:
  2091.  
  2092.      `mzip' [`-epqrwx']
  2093.  
  2094.    `Mzip' allows the following command line options:
  2095.  
  2096. `e'
  2097.      Ejects the disk.
  2098.  
  2099. `f'
  2100.      Force eject even if the disk is mounted (must be given in addition
  2101.      to `-e').
  2102.  
  2103. `r'
  2104.      Write protect the disk.
  2105.  
  2106. `w'
  2107.      Remove write protection.
  2108.  
  2109. `p'
  2110.      Password write protect.
  2111.  
  2112. `x'
  2113.      Password protect
  2114.  
  2115. `u'
  2116.      Temporarily unprotect the disk until it is ejected.  The disk
  2117.      becomes writable, and reverts back to its old state when ejected.
  2118.  
  2119. `q'
  2120.      Queries the status
  2121.  
  2122.    To remove the password, set it to one of the passwordless modes `-r'
  2123. or `-w': mzip will then ask you for the password, and unlock the disk.
  2124. If you have forgotten the password, you can get rid of it by low-level
  2125. formatting the disk (using your SCSI adaptor's BIOS setup).
  2126.  
  2127.    The ZipTools disk shipped with the drive is also password protected.
  2128. On Dos or on a Mac, this password is automatically removed once the
  2129. ZipTools have been installed.  From various articles posted to Usenet, I
  2130. learned that the password for the tools disk is
  2131. `APlaceForYourStuff'(1).  Mzip knows about this password, and tries it
  2132. first, before prompting you for a password.  Thus `mzip -w z:' unlocks
  2133. the tools disk(2).  The tools disk is formatted in a special way so as
  2134. to be usable both in a PC and in a Mac.  On a PC, the Mac filesystem
  2135. appears as a hidden file named `partishn.mac'.  You may erase it to
  2136. reclaim the 50 Megs of space taken up by the Mac filesystem.
  2137.  
  2138.    ---------- Footnotes ----------
  2139.  
  2140.    (1)  To see the articles, search for `APlaceForYourStuff' using
  2141. Dejanews
  2142.  
  2143.    (2)  I didn't know about this yet when I bought my own Zip drive.
  2144. Thus I ended up reformatting my tools disk, and hence I haven't had the
  2145. opportunity to test the password yet.  If anybody still has their tools
  2146. disk with the original password, could you try it out? Thanks in advance
  2147.  
  2148. 
  2149. File: mtools.info,  Node: xcopy,  Prev: mzip,  Up: Commands
  2150.  
  2151. Xcopy
  2152. =====
  2153.  
  2154.    The `xcopy' script is used to recursively copy one directory to
  2155. another. Its syntax is:
  2156.  
  2157.      `xcopy' SOURCEDIRECTORY TARGETDIRECTORY
  2158.  
  2159.    If targetdirectory does not exist, it is created.  If it does exist,
  2160. the files of sourcedirectory are directly copied into it, and no
  2161. subdirectory called SOURCEDIRECTORY is created, unlike with `cp -rf'.
  2162.  
  2163. Bugs
  2164. ----
  2165.  
  2166.    This command is a big kludge.  A proper implementation would take a
  2167. rework of significant parts of mtools, but unfortunately I don't have
  2168. the time for this right now. The main downside of this implementation is
  2169. that it is inefficient on some architectures (several successive calls
  2170. to mtools, which defeats mtools' caching).
  2171.  
  2172. 
  2173. File: mtools.info,  Node: Compiling mtools,  Next: Porting mtools,  Prev: Commands,  Up: Top
  2174.  
  2175. Architecture specific compilation flags
  2176. ***************************************
  2177.  
  2178.    To compile mtools, first invoke `./configure' before `make'. In
  2179. addition to the standard `autoconfigure' flags, there are two
  2180. architecture specific flags available.
  2181.  
  2182. `./configure --enable-xdf'
  2183. `./configure --disable-xdf'
  2184.      Enables support for XDF disks. This is on by default. *Note XDF::,
  2185.      for details.
  2186.  
  2187. `./configure --enable-vold'
  2188. `./configure --disable-vold'
  2189.      Enables support for vold on Solaris. When used in conjunction with
  2190.      vold, mtools should uses different device nodes as for direct
  2191.      access.
  2192.  
  2193. `./configure --enable-new-vold'
  2194. `./configure --disable-new-vold'
  2195.      Enables new support for vold on Solaris.  This is supposed to work
  2196.      more smoothly than the old support.
  2197.  
  2198. `./configure --enable-floppyd'
  2199. `./configure --disable-floppyd'
  2200.      Enables support for floppyd.  By default, floppyd support is
  2201.      enabled as long as the necessary X includes and libraries are
  2202.      available.
  2203.  
  2204. 
  2205. File: mtools.info,  Node: Porting mtools,  Next: Command Index,  Prev: Compiling mtools,  Up: Top
  2206.  
  2207. Porting mtools to architectures which are not supported yet
  2208. ***********************************************************
  2209.  
  2210.    This chapter is only interesting for those who want to port mtools to
  2211. an architecture which is not yet supported. For most common systems,
  2212. default drives are already defined. If you want to add default drives
  2213. for a still unsupported system, run config.guess, to see which
  2214. identification autoconf uses for that system. This identification is of
  2215. the form cpu-vendor-os (for example sparc-sun-sunos). The cpu and the
  2216. os parts are passed to the compiler as preprocessor flags.   The OS
  2217. part is passed to the compiler in three forms.
  2218.   1. The complete os name, with dots replaced by underscores.  sco3.2v2
  2219.      would yield sco3_2v2
  2220.  
  2221.   2. The base os name. Sco3.2v2 would yield Sco
  2222.  
  2223.   3. The base os name plus its major version. Sco3.2v2 would yield Sco3
  2224.  
  2225.    All three versions are passed, if they are different.
  2226.  
  2227.    To define the devices, use the entries for the systems that are
  2228. already present as templates. In general, they have the following form:
  2229.  
  2230.      #if (defined (my_cpu) && defined(my_os))
  2231.      #define predefined_devices
  2232.      struct device devices[] = {
  2233.              { "/dev/first_drive", 'drive_letter', drive_description},
  2234.              ...
  2235.              { "/dev/last_drive", 'drive_letter', drive_description}
  2236.      }
  2237.      #define INIT_NOOP
  2238.      #endif
  2239.  
  2240.    "/dev/first_drive" is the name of the device or image file
  2241. representing the drive. Drive_letter is a letter ranging from a to z
  2242. giving access to the drive. Drive_description describes the type of the
  2243. drive:
  2244. `ED312'
  2245.      extra density (2.88M) 3 1/2 disk
  2246.  
  2247. `HD312'
  2248.      high density 3 1/2 disk
  2249.  
  2250. `DD312'
  2251.      double density 3 1/2 disk
  2252.  
  2253. `HD514'
  2254.      high density 5 1/4 disk
  2255.  
  2256. `DD514'
  2257.      double density 5 1/4 disk
  2258.  
  2259. `DDsmall'
  2260.      8 sector double density 5 1/4 disk
  2261.  
  2262. `SS514'
  2263.      single sided double density 5 1/4 disk
  2264.  
  2265. `SSsmall'
  2266.      single sided 8 sector double density 5 1/4 disk
  2267.  
  2268. `GENFD'
  2269.      generic floppy drive (12 bit FAT)
  2270.  
  2271. `GENHD'
  2272.      generic hard disk (16 bit FAT)
  2273.  
  2274. `GEN'
  2275.      generic device (all parameters match)
  2276.  
  2277. `ZIPJAZ(flags)'
  2278.      generic ZIP drive using normal access. This uses partition 4.
  2279.      `Flags' are any special flags to be passed to open.
  2280.  
  2281. `RZIPJAZ(flags)'
  2282.      generic ZIP drive using raw SCSI access. This uses partition 4.
  2283.      `Flags' are any special flags to be passed to open.
  2284.  
  2285. `REMOTE'
  2286.      the remote drive used for floppyd.  Unlike the other items, this
  2287.      macro also includes the file name ($DISPLAY) and the drive letter
  2288.      (X)
  2289.  
  2290.    Entries may be described in more detail:
  2291.       fat_bits,open_flags,cylinders,heads,sectors,DEF_ARG
  2292.     or, if you need to describe an offset (filesystem doesn't start at
  2293. beginning of filesystem)
  2294.       fat_bits, open_flags, cylinders, heads, sectors, offset, DEF_ARG0
  2295.  
  2296. `fat_bits'
  2297.      is either 12, 16 or 0. 0 means that the device accepts both types
  2298.      of FAT.
  2299.  
  2300. `open_flags'
  2301.      may include flags such as O_NDELAY, or O_RDONLY, which might be
  2302.      necessary to open the device. 0 means no special flags are needed.
  2303.  
  2304. `cylinders,heads,sectors'
  2305.      describe the geometry of the disk. If cylinders is 0, the heads
  2306.      and sectors parameters are ignored, and the drive accepts any
  2307.      geometry.
  2308.  
  2309. `offset'
  2310.      is used if the DOS filesystem doesn't begin at the start of the
  2311.      device or image file. This is mostly useful for Atari Ram disks
  2312.      (which contain their device driver at the beginning of the file)
  2313.      or for DOS emulator images (which may represent a partitioned
  2314.      device.
  2315.  
  2316.    Definition of defaults in the devices file should only be done if
  2317. these same devices are found on a large number of hosts of this type.
  2318. In that case, could you also let me know about your new definitions, so
  2319. that I can include them into the next release.  For purely local file, I
  2320. recommend that you use the `/usr/freeware/etc/mtools.conf' and
  2321. `~/.mtoolsrc' configuration files.
  2322.  
  2323.    However, the devices files also allows to supply geometry setting
  2324. routines. These are necessary if you want to access high capacity disks.
  2325.  
  2326.    Two routines should be supplied:
  2327.  
  2328.   1. Reading the current parameters
  2329.           static inline int get_parameters(int fd, struct generic_floppy_struct *floppy)
  2330.  
  2331.      This probes the current configured geometry, and return it in the
  2332.      structure generic_floppy_struct (which must also be declared).
  2333.      Fd is an open file descriptor for the device, and buf is an already
  2334.      filled in stat structure, which may be useful.   This routine
  2335.      should return 1 if the probing fails, and 0 otherwise.
  2336.  
  2337.   2. Setting new parameters
  2338.           static inline int set_parameters(int fd, struct generic_floppy_struct *floppy)
  2339.                                            struct stat *buf)
  2340.       This configures the geometry contained in floppy on the file
  2341.      descriptor fd. Buf is the result of a stat call (already filled
  2342.      in).  This should return 1 if the new geometry cannot be
  2343.      configured, and 0 otherwise.
  2344.  
  2345.    A certain number of preprocessor macros should also be supplied:
  2346.  
  2347. `TRACKS(floppy)'
  2348.      refers to the track field in the floppy structure
  2349.  
  2350. `HEADS(floppy)'
  2351.      refers to the heads field in the floppy structure
  2352.  
  2353. `SECTORS(floppy)'
  2354.      refers to the sectors per track field in the floppy structure
  2355.  
  2356. `SECTORS_PER_DISK(floppy)'
  2357.      refers to the sectors per disk field in the floppy structure (if
  2358.      applicable, otherwise leave undefined)
  2359.  
  2360. `BLOCK_MAJOR'
  2361.      major number of the floppy device, when viewed as a block device
  2362.  
  2363. `CHAR_MAJOR'
  2364.      major number of the floppy device, when viewed as a character
  2365.      device (a.k.a. "raw" device, used for fsck) (leave this undefined,
  2366.      if your OS doesn't have raw devices)
  2367.  
  2368.    For the truly high capacity formats (XDF, 2m, etc), there is no clean
  2369. and documented interface yet.
  2370.  
  2371. 
  2372. File: mtools.info,  Node: Command Index,  Next: Variable Index,  Prev: Porting mtools,  Up: Top
  2373.  
  2374. Command Index
  2375. *************
  2376.  
  2377. * Menu:
  2378.  
  2379. * floppyd:                               floppyd.
  2380. * mattrib:                               mattrib.
  2381. * mbadblocks:                            mbadblocks.
  2382. * mcd:                                   mcd.
  2383. * mcd (introduction):                    directory.
  2384. * mcopy:                                 mcopy.
  2385. * mdel:                                  mdel.
  2386. * mdeltree:                              mdeltree.
  2387. * mdir:                                  mdir.
  2388. * mdu:                                   mdu.
  2389. * mformat:                               mformat.
  2390. * mformat (geometry used for):           geometry description.
  2391. * mkmanifest:                            mkmanifest.
  2392. * mlabel <1>:                            minfo.
  2393. * mlabel:                                mlabel.
  2394. * mmd:                                   mmd.
  2395. * mmount:                                mmount.
  2396. * mmove:                                 mmove.
  2397. * mpartition:                            mpartition.
  2398. * mrd:                                   mrd.
  2399. * mren:                                  mren.
  2400. * mshowfat:                              mshowfat.
  2401. * mtoolstest:                            mtoolstest.
  2402. * mzip:                                  mzip.
  2403. * xcopy:                                 xcopy.
  2404.  
  2405. 
  2406. File: mtools.info,  Node: Variable Index,  Next: Concept Index,  Prev: Command Index,  Up: Top
  2407.  
  2408. Variable index
  2409. **************
  2410.  
  2411. * Menu:
  2412.  
  2413. * cylinders:                             geometry description.
  2414. * drive:                                 general information.
  2415. * exclusive:                             open flags.
  2416. * fat_bits:                              misc variables.
  2417. * file:                                  misc variables.
  2418. * fucase:                                explicit tables.
  2419. * heads:                                 geometry description.
  2420. * mformat_only:                          misc flags.
  2421. * MTOOLS_FAT_COMPATIBILITY:              global variables.
  2422. * MTOOLS_LOWER_CASE:                     global variables.
  2423. * MTOOLS_NO_VFAT:                        global variables.
  2424. * MTOOLS_SKIP_CHECK:                     global variables.
  2425. * MTOOLSRC:                              Configuration.
  2426. * nodelay:                               open flags.
  2427. * sectors:                               geometry description.
  2428. * sync:                                  open flags.
  2429. * tounix:                                explicit tables.
  2430. * tracks:                                geometry description.
  2431. * use_xdf:                               misc flags.
  2432.  
  2433. 
  2434. File: mtools.info,  Node: Concept Index,  Prev: Variable Index,  Up: Top
  2435.  
  2436. Concept index
  2437. *************
  2438.  
  2439. * Menu:
  2440.  
  2441. * 2m <1>:                                2m.
  2442. * 2m:                                    bigger sectors.
  2443. * Accented characters:                   character sets.
  2444. * ALPHA patches:                         Location.
  2445. * APlaceForYourStuff:                    mzip.
  2446. * Archive bit:                           mattrib.
  2447. * Atari Ram disk:                        misc variables.
  2448. * Backwards compatibility:               old style config.
  2449. * Bad blocks:                            mbadblocks.
  2450. * blocksize:                             misc variables.
  2451. * bugs:                                  Location.
  2452. * Case sensitivity:                      case sensitivity.
  2453. * Changing file attributes:              mattrib.
  2454. * character devices:                     misc variables.
  2455. * Checking configuration file:           mtoolstest.
  2456. * Clusters of a file:                    mshowfat.
  2457. * Command list:                          Commands.
  2458. * Compile time configuration:            Compiling mtools.
  2459. * Compiled-in defaults:                  Porting mtools.
  2460. * Concatenating MS-DOS files:            mcopy.
  2461. * Configuration file:                    default values.
  2462. * Configuration file name:               config file location.
  2463. * Configuration file name (parsing order): parsing order.
  2464. * Configuration file parsing order:      parsing order.
  2465. * Configuration file syntax:             general syntax.
  2466. * Configuration file, old syntax:        old style config.
  2467. * Configuration files:                   Configuration.
  2468. * Configuration of disk geometry:        geometry description.
  2469. * Copying MS-DOS files:                  mcopy.
  2470. * CR/LF conversions:                     mcopy.
  2471. * Creating a directory:                  mmd.
  2472. * Current working directory:             directory.
  2473. * Current working directory (changing the): mcd.
  2474. * Default configuration:                 default values.
  2475. * Default directory:                     directory.
  2476. * Default directory (changing the):      mcd.
  2477. * Default values:                        default values.
  2478. * Deleting a directory:                  mrd.
  2479. * deleting an MS-DOS directory recursively: mdeltree.
  2480. * deleting MS-DOS files:                 mdel.
  2481. * Description of disk geometry:          geometry description.
  2482. * diffs:                                 Location.
  2483. * Directory:                             directory.
  2484. * Directory (changing):                  mcd.
  2485. * Directory creation:                    mmd.
  2486. * Directory listing:                     mdir.
  2487. * Directory removing:                    mrd.
  2488. * disable locking:                       misc flags.
  2489. * Disk Geometry:                         geometry description.
  2490. * Disk label:                            mlabel.
  2491. * DMF disks:                             more sectors.
  2492. * Dosemu hard disk image:                misc variables.
  2493. * Drive configuration:                   per drive variables.
  2494. * Drive configuration, example:          general information.
  2495. * Drive description:                     per drive variables.
  2496. * Drive description, example:            general information.
  2497. * Drive independent configuration variables: global variables.
  2498. * du:                                    mdu.
  2499. * Duplicate file names:                  name clashes.
  2500. * Ejecting a Zip/Jaz disk:               mzip.
  2501. * Environmental variables:               global variables.
  2502. * Erasing a directory:                   mrd.
  2503. * erasing an MS-DOS directory recursively: mdeltree.
  2504. * erasing MS-DOS files:                  mdel.
  2505. * exclusive access to a drive:           open flags.
  2506. * Executing commands before opening the device: misc variables.
  2507. * Fat:                                   mshowfat.
  2508. * fdformat:                              more sectors.
  2509. * File name of device node:              misc variables.
  2510. * Filenames:                             arguments.
  2511. * Filesystem creation:                   mformat.
  2512. * Format of disk:                        geometry description.
  2513. * Formats, high capacity:                high capacity formats.
  2514. * Formatting disks:                      mformat.
  2515. * FreeDos:                               global variables.
  2516. * getting parameters of a Dos fs:        minfo.
  2517. * Global configuration variables:        global variables.
  2518. * Hdimage:                               misc variables.
  2519. * Hidden files:                          mattrib.
  2520. * High capacity formats:                 high capacity formats.
  2521. * High capacity formats, mounting:       mmount.
  2522. * High density disk:                     geometry description.
  2523. * Image file:                            misc variables.
  2524. * Initializing disks:                    mformat.
  2525. * Internationalization:                  character sets.
  2526. * Jaz disk (utilities):                  mzip.
  2527. * Jaz disks (partitioning them):         mpartition.
  2528. * Jaz disks (partitions):                misc variables.
  2529. * Jaz disks (raw Scsi access):           misc flags.
  2530. * Labeling a disk:                       mlabel.
  2531. * Linux enhancements (High Capacity Formats): high capacity formats.
  2532. * Linux enhancements (mmount):           mmount.
  2533. * List of available commands:            Commands.
  2534. * Listing a directory:                   mdir.
  2535. * Listing space occupied by directories and files: mdu.
  2536. * Location of configuration files:       config file location.
  2537. * Location of configuration files (parsing order): parsing order.
  2538. * locking (disabling it):                misc flags.
  2539. * Long file name:                        long names.
  2540. * Low density disk:                      geometry description.
  2541. * Magneto-optical disks:                 misc variables.
  2542. * mailing list:                          Location.
  2543. * Making a directory:                    mmd.
  2544. * Marking blocks as bad:                 mbadblocks.
  2545. * Mcwd file:                             mcd.
  2546. * mformat parameters:                    minfo.
  2547. * Mounting a disk:                       mmount.
  2548. * Moving files (mmove):                  mmove.
  2549. * Moving files (mren):                   mren.
  2550. * Name clashes:                          name clashes.
  2551. * Name of configuration files:           config file location.
  2552. * Name of configuration files (parsing order): parsing order.
  2553. * Name of device node:                   misc variables.
  2554. * National character set:                character sets.
  2555. * Occupation of space by directories and files: mdu.
  2556. * Odd formats:                           high capacity formats.
  2557. * Old configuration file syntax:         old style config.
  2558. * open flags:                            open flags.
  2559. * Options:                               arguments.
  2560. * OS/2 (layout of removable media):      misc variables.
  2561. * OS/2 (XDF disks):                      XDF.
  2562. * Overwriting files:                     name clashes.
  2563. * packing list:                          mkmanifest.
  2564. * Parsing order:                         parsing order.
  2565. * Partitioned image file:                misc variables.
  2566. * partitions (creating):                 mpartition.
  2567. * password protected Zip disks:          mzip.
  2568. * patches:                               Location.
  2569. * plain floppy: device xxx busy:         misc flags.
  2570. * Porting:                               Porting mtools.
  2571. * Primary file name (long names):        long names.
  2572. * Primary file name (name clashes):      name clashes.
  2573. * Ram disk:                              misc variables.
  2574. * raw device:                            misc variables.
  2575. * Read errors:                           mbadblocks.
  2576. * Read-only files (changing the attribute): mattrib.
  2577. * Read-only files (listing them):        mdir.
  2578. * Reading MS-DOS files:                  mcopy.
  2579. * recursive copy:                        xcopy.
  2580. * recursively removing an MS-DOS directory: mdeltree.
  2581. * remote floppy access:                  floppyd.
  2582. * Removable media:                       misc variables.
  2583. * Removing a directory:                  mrd.
  2584. * removing an MS-DOS directory recursively: mdeltree.
  2585. * removing MS-DOS files:                 mdel.
  2586. * Renaming files (mmove):                mmove.
  2587. * Renaming files (mren):                 mren.
  2588. * SCSI devices:                          misc flags.
  2589. * Secondary file name (long names):      long names.
  2590. * Secondary file name (name clashes):    name clashes.
  2591. * setgid installation:                   misc flags.
  2592. * setuid installation:                   misc flags.
  2593. * setuid installation (needed for raw SCSI I/O): misc flags.
  2594. * Solaris (compile time configuration of vold): Compiling mtools.
  2595. * Solaris (Raw access to SCSI devices such as Zip & Jaz): misc flags.
  2596. * Solaris (volcheck):                    misc variables.
  2597. * Solaris (vold):                        misc flags.
  2598. * Space occupied by directories and files: mdu.
  2599. * Special formats:                       high capacity formats.
  2600. * Subdirectory creation:                 mmd.
  2601. * Subdirectory removing:                 mrd.
  2602. * SunOS (Raw access to SCSI devices such as Zip & Jaz): misc flags.
  2603. * synchronous writing:                   open flags.
  2604. * Syntax of the configuration file:      general syntax.
  2605. * Syquest disks:                         misc variables.
  2606. * Syquests (raw Scsi access):            misc flags.
  2607. * System files:                          mattrib.
  2608. * Testing configuration file for correctness: mtoolstest.
  2609. * Text files:                            mcopy.
  2610. * Tools disk (Zip and Jaz drives):       mzip.
  2611. * Verifying configuration file:          mtoolstest.
  2612. * VFAT-style file names:                 long names.
  2613. * vgacopy:                               more sectors.
  2614. * Vold (compile time configuration):     Compiling mtools.
  2615. * Vold (mediamgr):                       misc flags.
  2616. * Weird formats:                         high capacity formats.
  2617. * Windows 95 (DMF disks):                more sectors.
  2618. * Windows 95-style file names:           long names.
  2619. * Windows NT (layout of removable media): misc variables.
  2620. * Working directory <1>:                 directory.
  2621. * Working directory:                     mcd.
  2622. * Write protecting a Zip/Jaz disk:       mzip.
  2623. * Writing MS-DOS files:                  mcopy.
  2624. * X terminal:                            floppyd.
  2625. * xcopy:                                 xcopy.
  2626. * XDF disks:                             XDF.
  2627. * XDF disks (compile time configuration): Compiling mtools.
  2628. * XDF disks (how to configure):          misc flags.
  2629. * Zip disk (utilities):                  mzip.
  2630. * Zip disks (partitioning them):         mpartition.
  2631. * Zip disks (partitions):                misc variables.
  2632. * Zip disks (raw Scsi access):           misc flags.
  2633. * ZipTools disk:                         mzip.
  2634.  
  2635.  
  2636. 
  2637. Tag Table:
  2638. Node: Top1214
  2639. Node: Location3543
  2640. Node: Common features4832
  2641. Node: arguments5592
  2642. Node: drive letters7241
  2643. Node: directory8001
  2644. Node: long names8440
  2645. Node: name clashes10981
  2646. Node: case sensitivity13261
  2647. Node: high capacity formats14480
  2648. Node: more sectors15578
  2649. Node: bigger sectors16618
  2650. Node: 2m17331
  2651. Node: XDF18493
  2652. Node: exit codes19809
  2653. Node: bugs20441
  2654. Node: Configuration20968
  2655. Node: config file location22180
  2656. Node: general syntax22606
  2657. Node: default values23417
  2658. Node: global variables23939
  2659. Node: per drive variables26014
  2660. Node: general information26756
  2661. Node: geometry description27188
  2662. Node: open flags30871
  2663. Node: misc variables31452
  2664. Node: misc flags34207
  2665. Node: multiple descriptions37672
  2666. Node: character sets39324
  2667. Node: why39793
  2668. Node: country41908
  2669. Node: explicit tables43809
  2670. Node: parsing order47378
  2671. Node: old style config48549
  2672. Node: Commands49232
  2673. Node: floppyd50989
  2674. Node: mattrib55936
  2675. Node: mbadblocks57270
  2676. Node: mcd57893
  2677. Node: mcopy58748
  2678. Node: mdel61109
  2679. Node: mdeltree61441
  2680. Node: mdir61850
  2681. Node: mdu63000
  2682. Node: mformat63512
  2683. Node: mkmanifest67507
  2684. Node: minfo69450
  2685. Node: mlabel70001
  2686. Node: mmd70856
  2687. Node: mmount71189
  2688. Node: mmove71778
  2689. Node: mpartition72546
  2690. Node: mrd75887
  2691. Node: mren76235
  2692. Node: mshowfat76971
  2693. Node: mtoolstest77183
  2694. Node: mtype77746
  2695. Node: mzip78590
  2696. Node: xcopy80628
  2697. Node: Compiling mtools81390
  2698. Node: Porting mtools82484
  2699. Node: Command Index88401
  2700. Node: Variable Index89780
  2701. Node: Concept Index91020
  2702. 
  2703. End Tag Table
  2704.